Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(release): add automated github releases for workflow #413

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 30 additions & 7 deletions .github/workflows/build-publish-mcr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,51 @@ on:
- 'v[0-9]+.[0-9]+.[0-9]+-alpha.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+'

permissions:
contents: read

jobs:
publish-images:
prepare-variables:
permissions:
contents: read
runs-on:
labels: [self-hosted, "1ES.Pool=${{ vars.RELEASE_1ES_POOL }}"]
outputs:
prerelease: ${{ steps.vars.outputs.prerelease }}
steps:
- name: Harden Runner
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
with:
egress-policy: audit
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
- name: 'Set output variables'
id: vars
run: |
PRERELEASE=false
if [[ ${{ github.ref }} =~ refs/tags/v[0-9]+.[0-9]+.[0-9]+- ]]; then
PRERELEASE=true
fi
echo "prerelease=$PRERELEASE" >> "$GITHUB_OUTPUT"
release:
permissions:
contents: write # softprops/action-gh-release@v2
id-token: write # This is required for requesting the JWT
runs-on:
labels: [self-hosted, "1ES.Pool=${{ vars.RELEASE_1ES_POOL }}"]
needs: prepare-variables
steps:
- name: Harden Runner
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
with:
egress-policy: audit

- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
token: '${{ secrets.GITHUB_TOKEN }}'
prerelease: ${{ needs.prepare-variables.outputs.prerelease }}
- uses: ./.github/actions/install-deps

- name: Build and publish image
run: |
az login --identity
Expand Down