Skip to content

Publish main to Live by @CLJ2006 (db26ca32581d2a51ca5ea7f602aca87d31648661 - Merge pull request #36 from NHSDigital/APM-6390-sbom-update Added readme and sbom grype packages) #34

Publish main to Live by @CLJ2006 (db26ca32581d2a51ca5ea7f602aca87d31648661 - Merge pull request #36 from NHSDigital/APM-6390-sbom-update Added readme and sbom grype packages)

Publish main to Live by @CLJ2006 (db26ca32581d2a51ca5ea7f602aca87d31648661 - Merge pull request #36 from NHSDigital/APM-6390-sbom-update Added readme and sbom grype packages) #34

Workflow file for this run

name: Create Release and Publish to Live API Catalogue
run-name: Publish ${{ github.ref_name }} to Live by @${{ github.actor }} (${{ github.sha }} - ${{ github.event.head_commit.message }})
on:
push:
branches:
- main
jobs:
release_and_publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0 # Required for calculate_version.py script
- name: Setup Python environment and dependencies
run: |
pipx install poetry
poetry install
- name: Calculate version
run: echo "SPEC_VERSION=$(poetry run python scripts/calculate_version.py)" >> "$GITHUB_ENV"
- name: Set OAS info.version to ${{ env.SPEC_VERSION }}
run: sed -i 's/__VERSION__/${{ env.SPEC_VERSION }}/g' specification/proxygen.yaml
- name: Cache node modules
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-build-cache-npm-packages-${{ hashFiles('**/package-lock.json') }}
- name: Install repo
run: make install
- name: Vacuum OpenAPI Spec linter
run: make lint
- name: Create Release ${{ env.SPEC_VERSION }}
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.SPEC_VERSION }}
- name: Setup proxygen-cli
env:
PROXYGEN_PRIVATE_KEY: ${{ secrets.ENCODED_PROXYGEN_PRIVATE_KEY }}
PROXYGEN_KID: ${{ secrets.PROXYGEN_KID }}
PROXYGEN_CLIENT_ID: ${{ secrets.PROXYGEN_CLIENT_ID }}
run: |
pipx install proxygen-cli
pipx upgrade proxygen-cli
# Setup proxygen auth and settings
mkdir -p ${HOME}/.proxygen
echo "$PROXYGEN_PRIVATE_KEY" | base64 --decode > ${HOME}/.proxygen/key
envsubst < ./.github/proxygen-credentials-template.yaml > ${HOME}/.proxygen/credentials.yaml
envsubst < ./.github/proxygen-settings.yaml > ${HOME}/.proxygen/settings.yaml
proxygen status
- name: Publish spec
run: proxygen spec publish specification/proxygen.yaml --no-confirm