Publish Tag #46
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish Tag | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| release-type: | |
| required: true | |
| description: The type of release we are building. It could be commitly, release or dry-run | |
| type: choice | |
| options: | |
| - release | |
| - commitly | |
| - dry-run | |
| hermes-version: | |
| required: true | |
| description: The Hermes version to use for this tag | |
| type: string | |
| workflow_call: | |
| inputs: | |
| release-type: | |
| required: true | |
| description: The type of release we are building. It could be commitly, release or dry-run | |
| type: string | |
| hermes-version: | |
| required: true | |
| description: The Hermes version to use for this tag | |
| type: string | |
| jobs: | |
| publish: | |
| runs-on: [ubuntu-latest] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Print the target SHA and hermes version | |
| run: | | |
| echo "targetSha=${{ github.sha }}" | |
| echo "hermes-version=${{ inputs.hermes-version }}" | |
| - name: Create tag | |
| if: ${{ inputs.release-type == 'release' }} | |
| uses: actions/github-script@v5 | |
| with: | |
| script: | | |
| github.rest.git.createRef({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| ref: 'refs/tags/hermes-v${{ inputs.hermes-version }}', | |
| sha: '${{ github.sha }}', | |
| }) |