forked from Teapot321/M5Client
-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (55 loc) · 1.86 KB
/
gradle-publish.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
name: Gradle Package
on:
push:
branches:
- master
jobs:
build:
runs-on: windows-latest
permissions:
contents: write
packages: write
steps:
- uses: actions/checkout@v4
- name: Set up GraalVM 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'graalvm'
server-id: github
settings-path: ${{ github.workspace }}
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Get version and create Git Tag
id: get_version
run: |
$version = .\gradlew.bat properties | Select-String -Pattern 'version:' | ForEach-Object { $_ -replace 'version: ', '' }
echo "Extracted version: $version"
$tag = "v$version"
echo "TAG is set to: $tag"
echo "::set-output name=tag::$tag"
echo "::set-output name=version::$version"
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git tag $tag
git push https://x-access-token:${{ secrets.TOKEN }}@github.com/${{ github.repository }} $tag
- name: Package with jpackage
run: .\gradlew.bat jpackage
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.get_version.outputs.tag }}
name: "Release ${{ steps.get_version.outputs.version }}"
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
- name: Upload installer files
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.get_version.outputs.tag }}
files: |
build/installer/M5Client-*.exe
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}