Skip to content

Release

Release #33

Workflow file for this run

---
name: Release
"on":
workflow_run:
workflows: [Checks]
types: [completed]
branches: [main]
workflow_dispatch:
permissions:
contents: read
jobs:
info:
name: Info
runs-on: ubuntu-latest
outputs:
head_sha: ${{ steps.head_sha.outputs.head_sha }}
timestamp: ${{ steps.timestamp.outputs.timestamp }}
steps:
- name: Git Info
id: head_sha
env:
GH_TOKEN: ${{ github.token }}
GH_COBRA: 1
run: |
echo head_sha=$(gh api /repos/enterprise-contract/enterprise-contract-controller/git/matching-refs/heads/main --jq '.[0].object.sha') >> "$GITHUB_OUTPUT"
release:
permissions:
contents: write # for Git to git tag push and release
name: Release
runs-on: ubuntu-latest
needs: info
if: ${{ (github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.head_sha == needs.info.outputs.head_sha) || github.event.workflow_dispatch }}
steps:
- name: Checkout repository
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
with:
fetch-depth: 0
- name: Compute version
id: version
shell: bash
run: |
set -o errexit
set -o pipefail
set -o nounset
echo "version=$(./hack/next-version.sh)" >> "$GITHUB_ENV"
- name: API Release
uses: softprops/action-gh-release@69320dbe05506a9a39fc8ae11030b214ec2d1f87 # v2.0.5
with:
name: API Release ${{env.version}}
tag_name: ${{env.version}}
generate_release_notes: true