forked from misskey-dev/misskey
-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (65 loc) · 2.27 KB
/
mirror-misskey-js.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
name: Mirror misskey-js
on:
release:
types: [released]
permissions: {}
jobs:
mirror-misskey-js:
runs-on: ubuntu-latest
permissions:
contents: read
if: ${{ !endsWith(github.event.release.name, '.next') }}
steps:
- name: Checkout
uses: actions/[email protected]
- name: Setup pnpm
uses: pnpm/action-setup@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.node-version'
cache: 'pnpm'
- name: Enable Corepack
run: corepack enable
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Check if lock file is not modified
run: git diff --exit-code pnpm-lock.yaml
- name: Copy config file
run: cp .github/misskey/test.yml .config/default.yml
- name: Build
run: pnpm --filter misskey-js run build
- name: Get GitHub App Token
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.MISSKEY_JS_MIRROR_APP_ID }}
private-key: ${{ secrets.MISSKEY_JS_MIRROR_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
repositories: |
${{ vars.MISSKEY_JS_REPO_NAME }}
- name: Clone mirroring target repository
uses: actions/checkout@v4
with:
repository: ${{ github.repository_owner }}/${{ vars.MISSKEY_JS_REPO_NAME }}
ref: main
path: mirror
token: ${{ steps.app-token.outputs.token }}
- name: Remove contents in mirror
run: rm -rf ./mirror/built ./mirror/LICENSE ./mirror/README.md ./mirror/package.json
- name: Copy contents to mirror
run: cp -r ./packages/misskey-js/built ./packages/misskey-js/LICENSE ./packages/misskey-js/README.md ./packages/misskey-js/package.json ./mirror/
- name: Push contents to mirror
run: |
cd mirror
git config --local user.name 'github-actions[bot]'
git config --local user.email '41898282+github-actions[bot]@users.noreply.github.com'
git add .
git commit -a -m "Release/$RELEASE_NAME"
git tag "$RELEASE_NAME"
git push origin main
git push origin "$RELEASE_NAME"
env:
RELEASE_NAME: ${{ github.event.release.name }}
- name: Clean contents in mirror
run: rm -rf ./mirror