From d0073727215359f7228630723ed484d1e2599bfb Mon Sep 17 00:00:00 2001 From: Kamil Date: Fri, 22 Nov 2024 20:00:27 +0000 Subject: [PATCH] try to get the version from the refs --- .github/workflows/main.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6b09414..1700714 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,4 @@ -name: Build and Release on Main +name: Build and Release on Tag on: push: @@ -14,11 +14,11 @@ jobs: - name: Checkout repository uses: actions/checkout@v3 - # Extract version from version.py + # Extract the tag version - name: Extract Version id: extract_version run: | - version=$(python3 -c "import version; print(version.__version__)") + version=${GITHUB_REF#refs/tags/} echo "VERSION=$version" >> $GITHUB_ENV # Set up Docker @@ -39,7 +39,7 @@ jobs: with: context: . push: true - tags: ghcr.io/${{ github.repository}}:${{ env.VERSION }} + tags: ghcr.io/${{ github.repository }}:${{ env.VERSION }} # Create a release on GitHub - name: Create GitHub Release @@ -48,6 +48,5 @@ jobs: tag_name: ${{ env.VERSION }} name: Release ${{ env.VERSION }} generate_release_notes: true - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}