-
Notifications
You must be signed in to change notification settings - Fork 0
96 lines (94 loc) · 2.52 KB
/
release.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: Release packages
on:
push:
branches: [ main ]
schedule:
- cron: '38 7 * * *'
workflow_call:
workflow_dispatch:
jobs:
build-pkg:
uses: ./.github/workflows/build.yml
release-srcpkg:
name: Release updated source packages
needs: build-pkg
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: srcpkgs
path: srcpkg/
- name: Release
uses: softprops/action-gh-release@v2
with:
name: Source packages
tag_name: srcpkg
files: srcpkg/*.zip
release-pkg:
name: Release updated packages
needs: build-pkg
runs-on: ubuntu-latest
permissions:
contents: write
strategy:
matrix:
platform:
- tag: x86_64-windows
name: Windows x86_64
- tag: x86_64-linux
name: Linux x86_64
- tag: aarch64-linux
name: Linux aarch64
- tag: x86_64-darwin
name: Darwin x86_64
- tag: aarch64-darwin
name: Darwin aarch64
steps:
- name: Download built packages
uses: actions/download-artifact@v4
with:
name: pkgs-${{ matrix.platform.tag }}
path: dist/
- name: Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ matrix.platform.tag }}
files: dist/*.zip
update-meta:
name: Update metadata
needs: build-pkg
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Download updated metadata
uses: actions/download-artifact@v4
with:
name: meta-update
path: ./
- name: Download built packages
uses: actions/download-artifact@v4
with:
pattern: pkgs-*
path: dist/
merge-multiple: true
- name: Generate manifest
run: python3 update_manifest.py
- name: Commit and push update metadata
run: |
if ! git diff -s --exit-code lock.json manifest.json; then
git config --global user.name "Github Actions" &&
git config --global user.email "<>" &&
git add lock.json manifest.json &&
git commit -m 'actions: update metadata' &&
git push
fi