diff --git a/.github/workflows/package-release.yaml b/.github/workflows/package-release.yaml index 4fff009..5bf08b0 100644 --- a/.github/workflows/package-release.yaml +++ b/.github/workflows/package-release.yaml @@ -33,7 +33,7 @@ on: # default: true push: tags: - - '*' + - 'v*.*.*' jobs: test: @@ -47,26 +47,12 @@ jobs: # TEST_MULTI_ENVIRONMENTS: ${{ inputs.TEST_MULTI_ENVIRONMENTS }} secrets: inherit - # release: - # needs: test - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v3 - # - name: Create Release - # uses: actions/create-release@0cb9c9b65d5d1901c1f53e5e66eaf4afd303e70e - # with: - # tag_name: ${{ steps.tag-calculator.outputs.NEW_TAG }} - # release_name: Release ${{ steps.tag-calculator.outputs.NEW_TAG }} - # draft: false - # prerelease: false - create_release: + needs: test runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 @@ -87,11 +73,12 @@ jobs: run: | next_version=$((version + 1)) echo "Next version: $next_version" - + - name: Set tag name id: set_tag_name run: | - tag_name=v$next_version + next_version=$((${{ github.event_name == 'release' }} ? $(echo "${{ github.ref }}" | awk -F'/' '{print $3}') : $(echo "${{ github.ref }}-$(date +%s)" | awk -F'/' '{print $3}'))) + tag_name=v$(echo "$next_version" | cut -d'.' -f-3) echo "::set-output name=tag_name::$tag_name" continue-on-error: true