Skip to content

Commit 79920a1

Browse files
committed
build: add new workflow to upload release metadata
1 parent a1573d7 commit 79920a1

File tree

1 file changed

+31
-14
lines changed

1 file changed

+31
-14
lines changed

.github/workflows/update-release-metadata.yml

+31-14
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,30 @@ jobs:
2424
uses: actions/setup-node@v3
2525
with:
2626
node-version: 20
27-
28-
- name: Fetch the latest release data
27+
28+
- name: Setup Python
29+
uses: actions/setup-python@v4
30+
with:
31+
python-version: '3.10'
32+
33+
- name: Cache Python Dependencies
34+
uses: actions/cache@v3
35+
id: cache
36+
with:
37+
path: ~/.cache/pip
38+
key: ${{ runner.os }}-pip-${{ hashFiles('**/scripts/requirements.txt') }}
39+
restore-keys: |
40+
${{ runner.os }}-pip-
41+
42+
- name: Install Python Dependencies
43+
run: |
44+
pip install -r scripts/requirements.txt
45+
46+
- name: Fetch the Latest Release Data
2947
id: fetch_release
48+
env:
49+
VAULT_TOKEN: ${{ secrets.VAULT_TOKEN }}
50+
TOKEN_VALHALLA: ${{ secrets.TOKEN_VALHALLA }}
3051
run: |
3152
npx dotenv-vault@latest pull development -y --dotenvMe=${{ secrets.VAULT_TOKEN }}
3253
source .env
@@ -36,16 +57,12 @@ jobs:
3657
https://api.github.com/repos/${{ github.repository }}/releases/latest \
3758
-o $GITHUB_WORKSPACE/release_metadata.json
3859
39-
- name: Setup Git
40-
run: |
41-
git config user.name "${{ github.actor }}"
42-
git config user.email "${{ github.actor }}@users.noreply.github.com"
43-
44-
- name: Commit and push changes
60+
- name: Update Gist File
61+
env:
62+
GIST_ID: ${{ secrets.GIST_ID }}
63+
GIST_TOKEN: ${{ secrets.GIST_TOKEN }}
4564
run: |
46-
npx dotenv-vault@latest pull development -y --dotenvMe=${{ secrets.VAULT_TOKEN }}
47-
source .env
48-
git add $GITHUB_WORKSPACE/release_metadata.json
49-
git commit -m "Update release metadata"
50-
git remote set-url origin https://x-access-token:${TOKEN_VALHALLA}@github.com/${{ github.repository }}.git
51-
git push origin main
65+
python scripts/release_metadata.py \
66+
--gist-id $GIST_ID \
67+
--actor ${{ github.actor }} \
68+
--file-content "$(cat $GITHUB_WORKSPACE/release_metadata.json)"

0 commit comments

Comments
 (0)