Skip to content

cli: v0.128.0

cli: v0.128.0 #400

Workflow file for this run

on:
release:
types: [published]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
name: release-hvm
jobs:
check-hvm-released:
runs-on: [ARM64, self-hosted, Linux]
steps:
- name: Check Release
id: hvm_released
uses: actions/github-script@v5
with:
result-encoding: string
script: return context.ref.includes('refs/tags/hvm-v')
outputs:
hvm_released: ${{ steps.hvm_released.outputs.result }}
go-release-hvm:
runs-on: [ARM64, self-hosted, Linux]
if: ${{ needs.check-hvm-released.outputs.hvm_released == 'true' }}
needs:
- check-hvm-released
steps:
# See https://docs.github.com/en/actions/security-guides/automatic-token-authentication#using-the-github_token-in-a-workflow
# For why we need to generate a token and not use the default
- name: Generate token
id: generate_token
uses: chanzuckerberg/[email protected]
with:
app_id: ${{ secrets.CZI_RELEASE_PLEASE_APP_ID }}
private_key: ${{ secrets.CZI_RELEASE_PLEASE_PK }}
- name: Parse Version
id: parse_version
uses: actions/github-script@v5
with:
result-encoding: string
script: return context.ref.replace('refs/tags/hvm-', '')
- name: Create overall repo tag
uses: actions/github-script@v5
with:
script: |
try {
await github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'refs/tags/${{ steps.parse_version.outputs.result }}',
sha: context.sha
})
} catch(e) {
// tag may have existed, ignore the error
console.log(e)
}
- uses: actions/checkout@v3
# we need to fetch all history and tags,
# so we build the proper version
# NOTE: this needs to happen after the tag is created so the tag is present locally
with:
fetch-depth: 0
- uses: actions/setup-go@v4
with:
go-version-file: hvm/go.mod
cache: true
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v3
with:
version: latest
workdir: hvm
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
GORELEASER_CURRENT_TAG: ${{ steps.parse_version.outputs.result }}
create_and_release_jira_version:
# only run for cli releases
if: ${{ needs.check-hvm-released.outputs.hvm_released == 'true' }}
needs:
- check-hvm-released
- go-release-hvm # we need to wait for the release to finish before creating the jira version
uses: chanzuckerberg/github-actions/.github/workflows/[email protected]
with:
projectID: '10006'
projectKey: CCIE
jiraVersionPrefix: 'Happy'
secrets:
jiraToken: ${{ secrets.JIRA_TOKEN }}