release #15
This file contains 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: release | |
on: | |
workflow_dispatch: | |
inputs: | |
release: | |
description: 'is this an actual release?' | |
required: true | |
type: boolean | |
default: false | |
fail: | |
description: 'should a job fail?' | |
required: true | |
type: boolean | |
default: false | |
jobs: | |
ci: | |
uses: ./.github/workflows/ci.yml | |
with: | |
fail: ${{ inputs.fail }} | |
package: | |
runs-on: ubuntu-latest | |
needs: ci | |
steps: | |
- name: step1 | |
run: echo "building some packages" | |
- name: Download a single artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: my-artifact | |
- name: ls | |
run: ls | |
tag: | |
runs-on: ubuntu-latest | |
needs: package | |
if: ${{ inputs.release }} | |
steps: | |
- name: Create/update tag | |
uses: actions/github-script@v7 | |
with: | |
# instead of the default GITHUB_TOKEN, this could be a separate token that only gives permission to add tags | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
script: | | |
github.rest.git.createRef({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
ref: 'refs/tags/release-run-${{ github.run_id }}', | |
sha: context.sha | |
}) |