-
Notifications
You must be signed in to change notification settings - Fork 0
116 lines (108 loc) · 3.14 KB
/
release-manually.yml
File metadata and controls
116 lines (108 loc) · 3.14 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
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
name: Build for release
on:
workflow_dispatch:
jobs:
lint:
name: Lint CSS files
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Install dependencies
run: npm ci
working-directory: ./utils
- name: Run linter
run: npm run lint
working-directory: ./utils
- id: appVersion
run: echo "VERSION=$(cat VERSION.txt)" >> $GITHUB_OUTPUT
- name: Upload reports to artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: reports-v${{ steps.appVersion.outputs.version }}
path: |
linting-report.txt
build:
name: Build CSS files
needs: [lint]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Install dependencies
run: npm ci
working-directory: ./utils
- name: Run minifier
run: npm run minify
working-directory: ./utils
- name: Cache CSS
uses: actions/cache@v3
with:
path: |
assets/gh-base.min.css
assets/gh-dimmed.min.css
assets/gh-light.min.css
assets/gh-dark.min.css
enableCrossOsArchive: true
key: mincss-${{ hashFiles('assets/gh-base.css','assets/gh-dark.css','assets/gh-dimmed.css','assets/gh-light.css') }}
restore-keys: |
mincss-
release:
name: Create release
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Load minified CSS
uses: actions/cache@v3
with:
path: |
assets/gh-base.min.css
assets/gh-dimmed.min.css
assets/gh-light.min.css
assets/gh-dark.min.css
enableCrossOsArchive: true
fail-on-cache-miss: true
key: mincss-${{ hashFiles('assets/gh-base.css','assets/gh-dark.css','assets/gh-dimmed.css','assets/gh-light.css') }}
restore-keys: |
mincss-
id: cache-css
- id: appVersion
run: echo "VERSION=$(cat VERSION.txt)" >> $GITHUB_OUTPUT
- name: Upload files to artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: files-v${{ steps.appVersion.outputs.version }}
path: |
assets/gh-base.min.css
assets/gh-dimmed.min.css
assets/gh-light.min.css
assets/gh-dark.min.css
assets/config.yml
README.md
VERSION.txt
LICENSE.md
- name: Upload binary to release
uses: softprops/action-gh-release@v1
if: steps.cache-css.outputs.cache-hit == 'true'
with:
token: ${{ secrets.GITHUB_TOKEN }}
fail_on_unmatched_files: true
generate_release_notes: true
tag_name: v${{ steps.appVersion.outputs.version }}
name: v${{ steps.appVersion.outputs.version }}
files: |
assets/gh-base.min.css
assets/gh-dimmed.min.css
assets/gh-light.min.css
assets/gh-dark.min.css
assets/config.yml
README.md
VERSION.txt
LICENSE.md