From 876268d128c4402b3598beaac3bd344ad2125b15 Mon Sep 17 00:00:00 2001 From: exTerEX <30706568+exTerEX@users.noreply.github.com> Date: Sun, 13 Mar 2022 03:21:42 +0100 Subject: [PATCH] Fix tag handling --- .github/workflows/publish-docker.yml | 2 +- .github/workflows/release.yml | 22 ++++++++++++++++++---- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish-docker.yml b/.github/workflows/publish-docker.yml index 8929fab..640be8b 100644 --- a/.github/workflows/publish-docker.yml +++ b/.github/workflows/publish-docker.yml @@ -70,7 +70,7 @@ jobs: latest=true tags: | branch=main,value=latest - type=semver,pattern={{version}} + type=pep440,pattern={{version}} - name: Build and push Docker image id: build-and-push diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dd51b24..4e624e7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -125,14 +125,28 @@ jobs: run: python -m pip install --upgrade pip setuptools wheel - name: Build wheel of noaa - run: python -m pip wheel --use-pep517 --no-cache-dir . + run: python -m pip wheel --use-pep517 --wheel-dir wheels/ . + + - name: Extract Docker metadata + id: meta + uses: docker/metadata-action@v3.6.2 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + flavor: | + latest=true + tags: | + type=pep440,pattern={{version}} + + - name: Set tag var + id: tag + run: echo ::set-output name=pip_tag::$(echo ${{ steps.meta.outputs.tags }} | awk '{ print substr ($0, 3 ) }') - name: Upload and attach release asset to draft uses: actions/upload-release-asset@v1.0.2 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - upload_url: ${{ needs.draft.upload_url }} - asset_path: ./noaa-${{ github.ref }}.post0-py3-none-any.whl - asset_name: noaa-${{ github.ref }}-py3-none-any.whl + upload_url: ${{ needs.draft.outputs.upload_url }} + asset_path: ./wheels/noaa-${{ steps.tag.outputs.pip_tag }}-py3-none-any.whl + asset_name: noaa-${{ steps.tag.outputs.pip_tag }}-py3-none-any.whl asset_content_type: application/zip