-
Notifications
You must be signed in to change notification settings - Fork 1
78 lines (66 loc) · 2.2 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
name: Create Release
on:
push:
branches:
- release
jobs:
create_release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
fetch-tags: true
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 18
- name: Set up Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install dependencies
run: bun i
- name: Read package version
id: version
run: |
previous_version=$(git describe --tags --abbrev=0)
current_version=$(node -p -e "require('./package.json').version")
if [ "$previous_version" = "v$current_version" ]; then
echo "Error: Version has not changed since the last release."
exit 1
fi
echo "::set-output name=version::$current_version"
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.version.outputs.version }}
release_name: Release v${{ steps.version.outputs.version }}
draft: false
prerelease: false
- name: Build updater for Windows
run: npm run build-updater-windows
- name: Upload updater for Windows
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: build/bds-updater-windows.exe
asset_name: bds-updater-windows.exe
asset_content_type: application/octet-stream
- name: Build updater for Linux
run: npm run build-updater-linux
- name: Upload updater for Linux
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: build/bds-updater-linux
asset_name: bds-updater-linux
asset_content_type: application/octet-stream