forked from acquitelol/azalea
-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (45 loc) · 1.45 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
name: Build Azalea-maths and Release
on:
push:
workflow_dispatch:
jobs:
build:
name: Build codebase and release
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Get version
id: version
run: |
version=$(cat ./extension/manifest.json | grep -oE '[ ]+"version": "(.*)",' | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')
echo "value=$version" >> $GITHUB_OUTPUT
- name: Install dependencies
id: dependencies
run: |
npm i -g pnpm
pnpm i
- name: Build codebase
id: build
run: pnpm build
- name: Prepare for release
id: prepare
run: |
rm $GITHUB_WORKSPACE/builds/* || true
mkdir builds || true
mv dist/bundle.js ./builds
mv dist Azalea-${{ steps.version.outputs.value }}
zip -r Azalea.zip Azalea-${{ steps.version.outputs.value }} & wait $!;
git config --local user.email "[email protected]"
git config --local user.name "GitHub Actions"
git add builds
git commit -m "Build $GITHUB_SHA" || exit 0
git push
- name: Create release
uses: softprops/action-gh-release@v1
with:
token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
tag_name: "${{ steps.version.outputs.value }}"
name: "Azalea ${{ steps.version.outputs.value }}"
files: |
./*.zip