-
-
Notifications
You must be signed in to change notification settings - Fork 220
83 lines (68 loc) · 2.03 KB
/
sources.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
name: Sources
on:
push:
branches: [master, develop]
paths:
- '.github/workflows/sources.yml'
- 'scripts/generate-sources-metadata.js'
- 'scripts/package-sources.sh'
- 'src/sites/**/model.ts'
jobs:
sources:
name: Sources
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 16
- name: Install sites dependencies
working-directory: src/sites
run: npm ci
- name: Build sites
working-directory: src/sites
run: npm run build
- name: Generate sources metadata
run: node scripts/generate-sources-metadata.js ${{ github.ref_name }} | tee metadata.json
- name: Package sources
run: ./scripts/package-sources.sh
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: sources
path: |
metadata.json
sources_packages/*.zip
if-no-files-found: error
upload:
name: Upload to GitHub releases
runs-on: ubuntu-latest
needs: sources
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: sources
- name: Get date for body
id: date
run: echo "date=$(date +'%Y-%m-%d %H:%M:%S %Z')" >> $GITHUB_OUTPUT
- name: Upload result
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: sources-${{ github.ref_name }}
name: Sources (${{ github.ref_name }})
allowUpdates: true
draft: false
prerelease: true
artifacts: metadata.json,sources_packages/*.zip
body: |
Automatically uploaded by GitHub actions.
**Head:** ${{ github.sha }}
**Date:** ${{ steps.date.outputs.date }}
- uses: geekyeggo/delete-artifact@v4
with:
failOnError: false
name: sources