-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add daily or ad-hoc snapshot releases (#278)
## Description add a daily (or ad-hoc) github workflow for `snapshot` releases. this is to support the ability to publish a release of uds-core before official releases to enable folks to perform testing. ## Related Issue Relates to #266 ## Type of change - [ ] Bug fix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds functionality) - [ ] Other (security config, docs update, etc) ## Checklist before merging - [ ] Test, docs, adr added or updated as needed - [ ] [Contributor Guide Steps](https://github.com/defenseunicorns/uds-template-capability/blob/main/CONTRIBUTING.md)(https://github.com/defenseunicorns/uds-template-capability/blob/main/CONTRIBUTING.md#submitting-a-pull-request) followed
- Loading branch information
Showing
4 changed files
with
118 additions
and
28 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Release UDS Core Snapshot | ||
|
||
on: | ||
schedule: | ||
- cron: "0 10 * * *" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
publish-snapshot-release: | ||
permissions: | ||
contents: write | ||
packages: write | ||
uses: ./.github/workflows/publish.yaml | ||
with: | ||
snapshot: true | ||
secrets: inherit | ||
|
||
update-snapshot-latest-tag: | ||
needs: publish-snapshot-release | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
with: | ||
fetch-tags: 'true' | ||
- name: Update snapshot-latest tag | ||
run: | | ||
# get last release tag | ||
LAST_RELEASE_TAG="$(gh release list --exclude-drafts --exclude-pre-releases --json tagName --jq '.[0].tagName')" | ||
# cleanup old release | ||
if gh release view snapshot-latest; then | ||
gh release delete snapshot-latest --cleanup-tag -y | ||
fi | ||
# generate new release | ||
gh release create snapshot-latest -t "snapshot-latest" --prerelease --notes-start-tag "${LAST_RELEASE_TAG}" --generate-notes |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Release UDS Core | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
tag-new-version: | ||
permissions: write-all | ||
runs-on: ubuntu-latest | ||
outputs: | ||
release_created: ${{ steps.release-flag.outputs.release_created }} | ||
steps: | ||
- name: Create release tag | ||
id: tag | ||
uses: google-github-actions/release-please-action@a37ac6e4f6449ce8b3f7607e4d97d0146028dc0b # v4 | ||
- id: release-flag | ||
run: echo "release_created=${{ steps.tag.outputs.release_created || false }}" >> $GITHUB_OUTPUT | ||
|
||
publish-uds-core-release: | ||
needs: tag-new-version | ||
if: ${{ needs.tag-new-version.outputs.release_created == 'true'}} | ||
permissions: | ||
contents: write | ||
packages: write | ||
uses: ./.github/workflows/publish.yaml | ||
with: | ||
snapshot: false | ||
secrets: inherit |
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