Update CI and tooling (#80) #2
Workflow file for this run
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 | |
on: | |
push: | |
tags: | |
- "v*" | |
- "!v*-alpha.*" | |
- "!v*-beta.*" | |
- "!v*-rc.*" | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
- run: npm i -g @apidevtools/swagger-cli@4 | |
- name: Update Spec version | |
run: "sed -i 's/version: \"Dev/version: \"${{ github.ref_name }}/' ./keymanager-oapi.yaml" | |
- name: Bundle yaml spec | |
run: "swagger-cli bundle ./keymanager-oapi.yaml -r -t yaml -o ./deploy/keymanager-oapi.yaml" | |
- name: Bundle json spec | |
run: "swagger-cli bundle ./keymanager-oapi.yaml -r -t json -o ./deploy/keymanager-oapi.json" | |
- name: Update index.html | |
run: | | |
sed -i "/urls:/a \ {url: \"./releases/${{ github.ref_name }}/keymanager-oapi.json\", name: \"${{ github.ref_name }}\"}," ./index.html | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
commit-message: "Release ${{ github.ref_name }}" | |
branch: release-${{ github.ref_name }} | |
title: "Release ${{ github.ref_name }}" | |
body: "" | |
base: master | |
add-paths: index.html | |
- name: Create Release | |
id: create_release | |
uses: softprops/action-gh-release@v2 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
name: ${{ github.ref_name }} | |
tag_name: ${{ github.ref_name }} | |
draft: false | |
prerelease: false | |
files: | | |
./deploy/keymanager-oapi.yaml | |
./deploy/keymanager-oapi.json | |
fail_on_unmatched_files: true | |
- name: Rollback Release | |
if: failure() | |
uses: author/action-rollback@1.0.4 | |
with: | |
release_id: ${{ steps.create_release.outputs.id }} | |
tag: ${{ github.ref }} | |
delete_orphan_tag: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |