-
Notifications
You must be signed in to change notification settings - Fork 596
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: enhance release workflow with integration test status and dry r…
…un option (#5273) * feat: enhance release workflow with integration test status and dry run option * fix: pass secrets
- Loading branch information
1 parent
c8bf4dd
commit fb49522
Showing
2 changed files
with
50 additions
and
8 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 |
---|---|---|
|
@@ -2,19 +2,40 @@ name: Create new Release | |
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
dry_run: | ||
description: 'Test integration without publishing (dry run)' | ||
type: boolean | ||
required: false | ||
default: false | ||
repository_dispatch: | ||
types: perform-release | ||
schedule: | ||
- cron: '0 9 * * 1' | ||
|
||
jobs: | ||
build: | ||
run_integration_tests: | ||
name: Run Integration Tests | ||
uses: ./.github/workflows/integration-tests.yml | ||
permissions: | ||
contents: read | ||
actions: read | ||
secrets: | ||
INTEGRATION_TEST_VOTING_TOKEN: ${{ secrets.INTEGRATION_TEST_VOTING_TOKEN }} | ||
PIPER_INTEGRATION_GITHUB_TOKEN: ${{ secrets.PIPER_INTEGRATION_GITHUB_TOKEN }} | ||
PIPER_INTEGRATION_SONAR_TOKEN: ${{ secrets.PIPER_INTEGRATION_SONAR_TOKEN }} | ||
PIPER_TMSSERVICEKEY: ${{ secrets.PIPER_TMSSERVICEKEY }} | ||
|
||
publish: | ||
needs: run_integration_tests | ||
if: | | ||
needs.run_integration_tests.outputs.test_status == 'success' && | ||
github.event.inputs.dry_run != 'true' | ||
permissions: write-all | ||
name: Publish | ||
name: Publish Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: styfle/[email protected] | ||
|
||
- uses: actions/checkout@v4 | ||
|
||
- name: Prepare assets and increment version | ||
|
@@ -26,7 +47,9 @@ jobs: | |
cp ./piper_master-darwin.x86_64 ./piper-darwin.x86_64 | ||
cp ./piper_master-darwin.arm64 ./piper-darwin.arm64 | ||
npm install semver --quiet | ||
echo "PIPER_version=v$(node_modules/.bin/semver -i minor $(curl --silent "https://api.github.com/repos/$GITHUB_REPOSITORY/releases/latest" | jq -r .tag_name))" >> $GITHUB_ENV | ||
VERSION="v$(node_modules/.bin/semver -i minor $(curl --silent "https://api.github.com/repos/$GITHUB_REPOSITORY/releases/latest" | jq -r .tag_name))" | ||
echo "PIPER_version=$VERSION" >> $GITHUB_ENV | ||
echo "piper_version=$VERSION" >> "$GITHUB_OUTPUT" | ||
- uses: SAP/project-piper-action@master | ||
name: Publish prerelease | ||
|
@@ -67,7 +90,7 @@ jobs: | |
echo "release_id=$(jq 'first(.[] | select(.tag_name == "${{ env.PIPER_version }}")).id' resp.json)" >> "$GITHUB_OUTPUT" | ||
- name: Convert prereleae to Release | ||
- name: Convert prerelease to Release | ||
run: > | ||
curl --fail-with-body -L -X PATCH | ||
-H "Accept: application/vnd.github+json" | ||
|
@@ -92,10 +115,10 @@ jobs: | |
post: | ||
name: Post Action | ||
runs-on: ubuntu-latest | ||
needs: [build] | ||
if: always() | ||
needs: [publish] | ||
if: always() && github.event.inputs.dry_run != 'true' | ||
steps: | ||
# Check status of the worklfow | ||
# Check status of the workflow | ||
- uses: martialonline/workflow-status@v4 | ||
id: check | ||
|
||
|