-
Notifications
You must be signed in to change notification settings - Fork 3
62 lines (51 loc) · 2.18 KB
/
release.yml
File metadata and controls
62 lines (51 loc) · 2.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
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@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
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