-
Notifications
You must be signed in to change notification settings - Fork 0
139 lines (111 loc) · 3.71 KB
/
release.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
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
name: Release
on:
push:
tags:
- 'v*'
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Set Timezone
run: sudo timedatectl set-timezone "Asia/Shanghai"
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20.x
- run: npx changelogithub
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# binary:
# name: Bundle binary for ${{ matrix.target }}
# runs-on: ${{ matrix.os }}
# env:
# binary: anime
# archive: anime-${{ matrix.target }}.${{ matrix.archive }}
# checksum: anime-${{ matrix.target }}-sha256sum.txt
# strategy:
# fail-fast: false
# matrix:
# include:
# - target: linux
# os: ubuntu-latest
# dist: ./packages/cli/bin/anime
# archive: tar.gz
# - target: macos
# os: macos-latest
# dist: ./packages/cli/bin/anime
# archive: zip
# - target: windows
# os: windows-latest
# dist: .\packages\cli\bin\anime.exe
# archive: zip
# steps:
# - uses: szenius/[email protected]
# with:
# timezoneLinux: "Asia/Shanghai"
# timezoneMacos: "Asia/Shanghai"
# timezoneWindows: "China Standard Time"
# - uses: actions/checkout@v4
# - name: Setup pnpm
# uses: pnpm/[email protected]
# - name: Setup node
# uses: actions/setup-node@v4
# with:
# node-version: 20.x
# cache: pnpm
# - name: Install
# run: pnpm install
# - name: Build
# run: pnpm build
# - name: Test
# run: |
# pnpm test:ci
# ${{ matrix.dist }} --version
# ${{ matrix.dist }} --help
# - name: Create archive (linux)
# if: ${{ matrix.os == 'ubuntu-latest' }}
# run: |
# tar -czvf ${{ env.archive }} -C $(dirname ${{ matrix.dist }}) $(basename ${{ matrix.dist }})
# sha256sum ${{ env.archive }} > ${{ env.checksum }}
# - name: Create archive (macos)
# if: ${{ matrix.os == 'macos-latest' }}
# run: |
# zip -j ${{ env.archive }} ${{ matrix.dist }}
# shasum -a 256 ${{ env.archive }} > ${{ env.checksum }}
# - name: Create archive (windows)
# if: ${{ matrix.os == 'windows-latest' }}
# run: |
# Compress-Archive -DestinationPath ${{ env.archive }} -Path ${{ matrix.dist }}
# Get-FileHash ${{ env.archive }} -Algorithm SHA256 | Out-File ${{ env.checksum }}
# - name: Upload artifacts archive
# uses: actions/upload-artifact@v4
# with:
# name: ${{ env.archive }}
# path: ${{ env.archive }}
# - name: Upload artifacts checksum
# uses: actions/upload-artifact@v4
# with:
# name: ${{ env.checksum }}
# path: ${{ env.checksum }}
# - name: Upload binary to release
# if: ${{ startsWith(github.ref, 'refs/tags/v') }}
# uses: svenstaro/upload-release-action@v2
# with:
# overwrite: true
# tag: ${{ github.ref }}
# repo_token: ${{ secrets.GITHUB_TOKEN }}
# file: ${{ env.archive }}
# asset_name: ${{ env.archive }}
# - name: Upload checksum to release
# if: ${{ startsWith(github.ref, 'refs/tags/v') }}
# uses: svenstaro/upload-release-action@v2
# with:
# overwrite: true
# tag: ${{ github.ref }}
# repo_token: ${{ secrets.GITHUB_TOKEN }}
# file: ${{ env.checksum }}
# asset_name: ${{ env.checksum }}