forked from felixonmars/fcitx5-pinyin-zhwiki
-
Notifications
You must be signed in to change notification settings - Fork 6
65 lines (57 loc) · 1.94 KB
/
build_dict.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
name: Build dictionary
on:
push:
branches:
- pkg-moegirl
workflow_dispatch: {}
permissions:
contents: write
jobs:
build-and-publish:
if: (contains(github.event_name, 'schedule') || !contains(github.event.commits[0].message, 'ci ckip'))
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}
persist-credentials: false
fetch-depth: '0'
path: 'toolkit'
- name: Build dictionary
run: |
mkdir $GITHUB_WORKSPACE/artifacts
docker run -v $GITHUB_WORKSPACE/artifacts:/artifacts -v $GITHUB_WORKSPACE/toolkit:/toolkit archlinux:base-devel bash /toolkit/utils/build.sh
- name: Checkout profile
uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}
persist-credentials: false
fetch-depth: '0'
path: 'profile'
- name: Update date
run: |
pushd profile
export DATE=`date +%Y%m%d`
echo $DATE > LATEST
git add ./LATEST
git config --local user.email "[email protected]"
git config --local user.name "GitHub Actions"
git commit -m "chore: version $DATE"
popd
- name: Push the commit
uses: ad-m/github-push-action@master
with:
branch: ${{ github.ref_name }}
github_token: ${{ secrets.GITHUB_TOKEN }}
directory: profile
- name: Release
shell: bash
run: |
export DATE=`date +%Y%m%d`
wget https://github.com/tcnksm/ghr/releases/download/v0.15.0/ghr_v0.15.0_linux_amd64.tar.gz -O ghr.tgz
tar xzf ghr.tgz
pushd profile
export COMMIT=$(git rev-parse HEAD)
popd
ghr_v0.15.0_linux_amd64/ghr -t ${{ secrets.GITHUB_TOKEN }} -u ${GITHUB_REPOSITORY/\/*/} -r ${GITHUB_REPOSITORY/*\//} -c "$COMMIT" -delete ${DATE} ./artifacts/