-
Notifications
You must be signed in to change notification settings - Fork 3
73 lines (68 loc) · 2.22 KB
/
release-package.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
name: Release Packages
on:
workflow_call:
env:
THEME_NAME: "logseq-developer-theme"
FONTS_PATH: "~/fonts"
jobs:
merge-dev-theme:
runs-on: ubuntu-latest
steps:
- name: Checkout theme files
uses: actions/checkout@v4
with:
ref: release
fetch-depth: 0
path: pre-release
- name: Get logseq-dev-theme files
uses: actions/checkout@v4
with:
repository: pengx17/logseq-dev-theme
fetch-depth: 0
path: logseq-dev-theme
- name: Install & Compile scss
run: |
cd logseq-dev-theme
npm install -g sass
sass --no-source-map --style compressed ./src/main.scss custom.css
- name: Theme files
run: |
mkdir release
cat logseq-dev-theme/custom.css pre-release/custom.css > release/custom.css
cat logseq-dev-theme/custom.css pre-release/no-bullet-threading.css > release/no-bullet-threading.css
cat logseq-dev-theme/custom.css pre-release/export.css > release/export.css
- name: Upload Theme CSS
uses: actions/upload-artifact@v4
with:
name: release-theme
path: release
release-package:
if: startsWith(github.ref, 'refs/tags/')
needs: [merge-dev-theme]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Load Fonts From Cache
id: get-css-fonts
uses: actions/cache@v3
with:
path: ${{ env.FONTS_PATH }}
key: ${{ runner.os }}-css-fonts
- name: Download Theme files
uses: actions/download-artifact@v4
with:
name: release-theme
path: ${{ github.workspace }}
- if: ${{ steps.get-css-fonts.outputs.cache-hit == 'true' }}
run: mkdir fonts && cp ${{ env.FONTS_PATH }}/*.ttf fonts
- name: zip themem css
run: |
if [ ! -d fonts ]; then mkdir fonts; fi
version=`git tag --sort=-v:refname | head -n 1`
zip -qq -r ${{ env.THEME_NAME }}-${version}.zip *.css package.json LICENSE fonts
- uses: softprops/action-gh-release@v1
with:
files: ${{ env.THEME_NAME }}-*.zip
draft: true