-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (35 loc) · 1.21 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
name: Build and Release
on:
push:
branches:
- develop
jobs:
build-and-release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
- name: Install dependencies
run: npm i
- name: Build
run: npm run build
- name: Get version and Minecraft info
id: package-info
run: |
echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
echo "minecraft=$(node -p "require('./package.json').minecraft")" >> $GITHUB_OUTPUT
- name: Create Release
if: success()
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create v${{ steps.package-info.outputs.version }} \
--title "Release v${{ steps.package-info.outputs.version }} for Minecraft ${{ steps.package-info.outputs.minecraft }}" \
--notes "Release for @sanctumterra/client v${{ steps.package-info.outputs.version }}
Compatible with Minecraft ${{ steps.package-info.outputs.minecraft }}" \
--target ${{ github.sha }}