-
-
Notifications
You must be signed in to change notification settings - Fork 14
98 lines (79 loc) · 2.83 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
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
name: Build
on:
push:
branches:
- master
- stable
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4.1.1
- name: Set up Node.js
uses: actions/setup-node@v4.0.2
with:
node-version: '21'
- name: Set up Java
uses: actions/setup-java@v4.0.0
with:
java-version: '21'
distribution: 'temurin'
- name: Get next version
uses: reecetech/version-increment@2023.10.2
id: version
with:
scheme: semver
release_branch: stable
increment: patch
- name: Tag Commit
if: github.ref == 'refs/heads/stable'
uses: CrabMatrix/github-tagger@v1.0.16
with:
tag: ${{ steps.version.outputs.version }}
repo-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Build package
run: |
echo "Building package"
make pkg
- name: Update package version
run: |
echo "Updating package version to ${{ steps.version.outputs.version }}"
sed -i "s/\"version\": \".*\"/\"version\": \"${{ steps.version.outputs.version }}\"/" temp_files/sabre/package.json
- name: Publish package
run: |
echo "Publishing package"
pushd temp_files/sabre && npm config set _authToken=$NODE_AUTH_TOKEN && npm config fix && npm publish && popd
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
- name: Create release
if: github.ref == 'refs/heads/stable'
id: create_release
uses: release-drafter/release-drafter@v6.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
config-file: .github/release-drafter.yml
tag: ${{ steps.version.outputs.version }}
name: ${{ steps.version.outputs.version }}
version: ${{ steps.version.outputs.version }}
- name: Zip Release
if: github.ref == 'refs/heads/stable'
run: zip -r -9 SABRE,js-${{ steps.version.outputs.version }}.zip ./bin ./debugbin ./LICENSE.md
- name: Upload Release
if: github.ref == 'refs/heads/stable'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./SABRE,js-${{ steps.version.outputs.version }}.zip
asset_name: SABRE,js-${{ steps.version.outputs.version }}.zip
asset_content_type: application/zip
- name: Publish Release
if: github.ref == 'refs/heads/stable'
uses: eregon/publish-release@v1.0.5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_id: ${{ steps.create_release.outputs.id }}