-
Notifications
You must be signed in to change notification settings - Fork 0
126 lines (109 loc) · 3.24 KB
/
Copy pathrelease.yml
File metadata and controls
126 lines (109 loc) · 3.24 KB
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
name: Release
on:
push:
tags:
- "v[0-9]*.[0-9]*.[0-9]*"
# Dispatched on a tag ref by auto-release.yml; the version check below
# rejects a dispatch on a branch ref.
workflow_dispatch:
permissions:
contents: read
jobs:
package:
name: Package (${{ matrix.name }})
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- name: Linux x64
runner: ubuntu-22.04
artifact: linux-x64
- name: Linux ARM64
runner: ubuntu-22.04-arm
artifact: linux-arm64
- name: macOS ARM64
runner: macos-latest
artifact: macos-arm64
- name: macOS x64
runner: macos-15-intel
artifact: macos-x64
- name: Windows x64
runner: windows-latest
artifact: windows-x64
steps:
- uses: actions/checkout@v7
- uses: actions/setup-java@v6
with:
distribution: temurin
java-version: 25
- uses: gradle/actions/setup-gradle@v6
- name: Resolve release version
shell: bash
run: |
release_version="${GITHUB_REF_NAME#v}"
if [[ ! "$release_version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Unsupported release tag: $GITHUB_REF_NAME" >&2
exit 1
fi
echo "RELEASE_VERSION=$release_version" >> "$GITHUB_ENV"
- name: Build and package
shell: bash
run: ./gradlew clean build releaseBundle -PreleaseVersion="$RELEASE_VERSION"
- name: Test installer
if: runner.os != 'Windows'
shell: bash
run: tests/test-install.sh
- name: Test installer
if: runner.os == 'Windows'
shell: pwsh
run: tests/test-install.ps1
- uses: actions/upload-artifact@v6
with:
name: release-${{ matrix.artifact }}
path: build/release/*
if-no-files-found: error
compression-level: 0
publish:
name: Publish GitHub release
needs: package
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v7
- uses: actions/download-artifact@v7
with:
pattern: release-*
path: release
merge-multiple: true
- name: Verify release assets
shell: bash
run: |
cd release
assets=(
jmix-cli-linux-x64.tar.gz
jmix-cli-linux-arm64.tar.gz
jmix-cli-macos-x64.tar.gz
jmix-cli-macos-arm64.tar.gz
jmix-cli-windows-x64.zip
)
for asset in "${assets[@]}"; do
test -f "$asset"
test -f "$asset.sha256"
sha256sum --check "$asset.sha256"
done
test "$(find . -maxdepth 1 -type f | wc -l)" -eq 10
- name: Add bootstrap installers
run: |
cp install.sh release/install.sh
cp install.ps1 release/install.ps1
- name: Create release
env:
GH_TOKEN: ${{ github.token }}
run: >-
gh release create "$GITHUB_REF_NAME" release/*
--repo "$GITHUB_REPOSITORY"
--verify-tag
--generate-notes
--title "Jmix CLI $GITHUB_REF_NAME"