diff options
author | Austin S. Hemmelgarn <austin@netdata.cloud> | 2022-04-15 08:17:46 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-15 08:17:46 -0400 |
commit | 19fa9e355c48b4c76966abfec8fe2cf6342ee22e (patch) | |
tree | 92bdcd54e501ba6898b86a79a2de7876a121f6f0 /.github | |
parent | 1b8b7b7efddc574dcb0d3a68e4ceab46397fc3b9 (diff) |
Ensure versioned release tags include a leading `v` in workflows. (#12695)
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/build.yml | 19 | ||||
-rw-r--r-- | .github/workflows/docker.yml | 24 |
2 files changed, 39 insertions, 4 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index caa49e2907..a50f9df5a7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -654,6 +654,22 @@ jobs: && github.event_name != 'pull_request' }} + normalize-tag: # Fix the release tag if needed + name: Normalize Release Tag + runs-on: ubuntu-latest + if: github.event_name == 'workflow_dispatch' && github.event.inputs.type == 'release' + outputs: + tag: ${{ steps.tag.outputs.tag }} + steps: + - name: Normalize Tag + id: tag + run: | + if echo ${{ github.event.inputs.version }} | grep -qE '^[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+$'; then + echo "::set-output name=tag::v${{ github.event.inputs.version }}" + else + echo "::set-output name=tag::${{ github.event.inputs.version }}" + fi + upload-release: # Create the draft release and upload the build artifacts. name: Create Release Draft runs-on: ubuntu-latest @@ -663,6 +679,7 @@ jobs: - source-build - artifact-verification-dist - artifact-verification-static + - normalize-tag steps: - name: Checkout id: checkout @@ -681,7 +698,7 @@ jobs: artifactErrorsFailBuild: true artifacts: 'final-artifacts/sha256sums.txt,final-artifacts/netdata-*.tar.gz,final-artifacts/netdata-*.gz.run' draft: true - tag: ${{ github.event.inputs.version }} + tag: ${{ needs.normalize-tag.outputs.tag }} token: ${{ secrets.NETDATABOT_GITHUB_TOKEN }} - name: Failure Notification uses: rtCamp/action-slack-notify@v2 diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 5a45b0f98a..10d7093ad6 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -116,10 +116,28 @@ jobs: && startsWith(github.ref, 'refs/heads/master') }} + normalize-tag: # Fix the release tag if needed + name: Normalize Release Tag + runs-on: ubuntu-latest + if: github.event_name == 'workflow_dispatch' + outputs: + tag: ${{ steps.tag.outputs.tag }} + steps: + - name: Normalize Tag + id: tag + run: | + if echo ${{ github.event.inputs.version }} | grep -qE '^[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+$'; then + echo "::set-output name=tag::v${{ github.event.inputs.version }}" + else + echo "::set-output name=tag::${{ github.event.inputs.version }}" + fi + docker-publish: if: github.event_name == 'workflow_dispatch' name: Docker Build and Publish - needs: docker-test + needs: + - docker-test + - normalize-tag runs-on: ubuntu-latest steps: - name: Checkout @@ -131,7 +149,7 @@ jobs: id: release-tags if: github.event.inputs.version != 'nightly' run: | - echo "tags=netdata/netdata:latest,netdata/netdata:stable,$(.github/scripts/gen-docker-tags.py ${{ github.event.inputs.version }})" \ + echo "tags=netdata/netdata:latest,netdata/netdata:stable,$(.github/scripts/gen-docker-tags.py ${{ needs.normalize-tag.outputs.tag }})" \ >> "${GITHUB_ENV}" - name: Determine which tags to use id: nightly-tags @@ -195,4 +213,4 @@ jobs: repo: netdata/helmchart workflow: Agent Version PR ref: refs/heads/master - inputs: '{"agent_version": "${{ github.event.inputs.version }}"}' + inputs: '{"agent_version": "${{ needs.normalize-tag.outputs.tag }}"}' |