-
-
Notifications
You must be signed in to change notification settings - Fork 8
68 lines (57 loc) · 1.89 KB
/
update-release-metadata.yml
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
63
64
65
66
67
68
name: Update Release Metadata
on:
workflow_run:
workflows: ["Build and Publish PHP Extension"]
types:
- completed
permissions:
contents: write
jobs:
update-release:
name: Update release metadata
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 20
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Cache Python Dependencies
uses: actions/cache@v3
id: cache
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/scripts/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install Python Dependencies
run: |
pip install -r scripts/requirements.txt
- name: Fetch the Latest Release Data
id: fetch_release
env:
VAULT_TOKEN: ${{ secrets.VAULT_TOKEN }}
TOKEN_VALHALLA: ${{ secrets.TOKEN_VALHALLA }}
run: |
npx dotenv-vault@latest pull development -y --dotenvMe=${{ secrets.VAULT_TOKEN }}
source .env
curl \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${TOKEN_VALHALLA}" \
https://api.github.com/repos/${{ github.repository }}/releases/latest \
-o $GITHUB_WORKSPACE/release_metadata.json
- name: Update Gist File
env:
GIST_ID: ${{ secrets.GIST_ID }}
GIST_TOKEN: ${{ secrets.GIST_TOKEN }}
run: |
python scripts/release_metadata.py \
--gist-id $GIST_ID \
--actor ${{ github.actor }} \
--file-content "$(cat $GITHUB_WORKSPACE/release_metadata.json)"