forked from EhTagTranslation/EhSyringe
-
Notifications
You must be signed in to change notification settings - Fork 1
67 lines (62 loc) · 2.17 KB
/
build.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
name: build
on:
push:
branches:
- master
create:
tags:
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Install
uses: bahmutov/npm-install@v1
- name: yarn build
run: |
yarn build:firefox
yarn build:chrome
yarn build:monkey
- uses: actions/upload-artifact@v3
with:
name: releases
path: releases/*
deploy:
needs: build
runs-on: ubuntu-latest
if: github.event_name == 'create' && github.event.ref_type == 'tag'
steps:
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: releases
path: releases/
- name: Publish to github release
uses: ncipollo/release-action@v1.10.0
with:
allowUpdates: true
artifacts: releases/*
body: |
[更新日志](https://github.com/EhTagTranslation/EhSyringe/blob/master/CHANGELOG.md)
prerelease: ${{ contains(github.event.ref, '-') }}
replacesArtifacts: true
token: ${{ secrets.GITHUB_TOKEN }}
- name: Commit release mirror
run: >
cd ./releases
&& git init
&& git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
&& git config user.name 'github-actions[bot]'
&& git add .
&& git commit -am 'Release for https://github.com/EhTagTranslation/EhSyringe/tree/${{ github.event.ref }}'
- name: Push to release branch
uses: ad-m/github-push-action@v0.6.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: release
force: true
directory: releases/