Release Workflow #25
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
name: Release Workflow | |
on: | |
workflow_dispatch: | |
inputs: | |
release-version: | |
description: 'Version being released' | |
required: true | |
dev-version: | |
description: 'Next -Dev version' | |
required: true | |
branch: | |
description: 'Branch to release from' | |
required: true | |
default: 'main' | |
jobs: | |
release: | |
runs-on: ubuntu-22.04 | |
if: github.repository_owner == 'Apicurio' | |
steps: | |
- name: Log Metadata | |
run: | | |
echo "===========================================================================================================" | |
echo "Release Module: ${{ env.GITHUB_REPOSITORY }} | |
echo "Release Version: ${{ github.event.inputs.release-version }} | |
echo "Release Branch: ${{ github.event.inputs.branch }}" | |
echo "Release Actor: ${{ env.GITHUB_ACTOR }}" | |
echo "Next Snapshot Version: ${{ github.event.inputs.dev-version }}" | |
echo "===========================================================================================================" | |
- name: Configure Git | |
run: | | |
git config --global user.name "apicurio-ci[bot]" | |
git config --global user.email "[email protected]" | |
- name: Checkout Code with Ref ${{github.event.inputs.BRANCH}} | |
uses: actions/checkout@v2 | |
with: | |
ref: ${{ github.event.inputs.branch }} | |
token: ${{ secrets.ACCESS_TOKEN }} | |
path: studio | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
- name: Update Release Version ${{ github.event.inputs.release-version }} in package.json files | |
run: | | |
UI_VERSION=$(echo "${{ github.event.inputs.release-version}}" | awk -F '[.-]' '{print $1"."$2"."$3}') | |
cd studio/ui | |
npm version $UI_VERSION --allow-same-version | |
cd ui-app | |
npm version $UI_VERSION --allow-same-version | |
cd ../ui-editors | |
npm version $UI_VERSION --allow-same-version | |
cd ../tests | |
npm version $UI_VERSION --allow-same-version | |
- name: Build Apicurio Studio | |
run: | | |
cd studio/ui | |
npm install | |
npm run lint | |
npm run build | |
npm run package | |
- name: Import GPG Key | |
if: github.event.inputs.skip-maven-deploy == 'false' | |
uses: crazy-max/ghaction-import-gpg@v1 | |
env: | |
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} | |
PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
- name: Push Changes for Release Version ${{ github.event.inputs.release-version }} | |
run: | | |
cd studio | |
git add . | |
git commit -m "Automated update for Release Version: ${{ github.event.inputs.release-version }}" | |
git push origin ${{github.event.inputs.branch}} | |
- name: Fetch Latest Commit SHA | |
run: | | |
cd studio | |
echo "latest-commit-sha=$(git log -n 1 --pretty=format:"%H")" >> $GITHUB_ENV | |
- name: Create GitHub Release | |
uses: softprops/action-gh-release@1e07f4398721186383de40550babbdf2b84acfc5 | |
with: | |
name: ${{ github.event.inputs.release-version }} | |
tag_name: ${{ github.event.inputs.release-version }} | |
token: ${{ secrets.ACCESS_TOKEN }} | |
target_commitish: ${{ env.latest-commit-sha }} | |
prerelease: false | |
- name: Update Next Snapshot Version ${{ github.event.inputs.dev-version }} | |
run: | | |
UI_VERSION=$(echo ${{ github.event.inputs.dev-version }} | sed 's/-SNAPSHOT//') | |
cd studio/ui | |
npm version $UI_VERSION --allow-same-version | |
cd ui-app | |
npm version $UI_VERSION --allow-same-version | |
cd ../ui-editors | |
npm version $UI_VERSION --allow-same-version | |
cd ../tests | |
npm version $UI_VERSION --allow-same-version | |
- name: Push Changes for Next Snapshot Version ${{ github.event.inputs.dev-version }} | |
run: | | |
cd studio | |
git add . | |
git commit -m "Automated update for Next Snapshot Version: ${{ github.event.inputs.dev-version }}" | |
git push origin ${{github.event.inputs.branch}} | |
- name: Google Chat Notification (Always) | |
if: always() | |
uses: Co-qn/google-chat-notification@b9227d9daa4638c9782a5bd16c4abb86268127a1 | |
with: | |
name: ${{ github.job }} | |
url: ${{ secrets.GOOGLE_CHAT_WEBHOOK }} | |
status: ${{ job.status }} | |
- name: Google Chat Notification (Error) | |
if: failure() | |
uses: Co-qn/google-chat-notification@b9227d9daa4638c9782a5bd16c4abb86268127a1 | |
with: | |
name: ${{ github.job }} | |
url: ${{ secrets.GOOGLE_CHAT_WEBHOOK_ERRORS }} | |
status: ${{ job.status }} |