-
Notifications
You must be signed in to change notification settings - Fork 3
93 lines (89 loc) · 2.79 KB
/
test-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
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
name: Test and publish
on:
push:
branches: [ main ]
tags: [ v* ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ${{ matrix.os }}
timeout-minutes: 15
strategy:
matrix:
include:
- os: ubuntu-latest
targets: native,common
- os: macos-latest
targets: native
- os: windows-latest
targets: native
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
- run: |
# azure.archive.ubuntu.com is flaky
sudo sed -i 's/azure.archive.ubuntu.com/archive.ubuntu.com/' /etc/apt/sources.list
sudo apt-get update
sudo apt-get install -y libunistring-dev libc6-dev-i386
if: runner.os == 'Linux'
- run: ./gradlew assemble check
env:
ORG_GRADLE_PROJECT_targets: ${{ matrix.targets }}
shell: bash
publish:
needs: test
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
matrix:
include:
- os: ubuntu-latest
targets: all
publishRootTarget: true
- os: macos-latest
targets: native
publishRootTarget: false
- os: windows-latest
targets: native
publishRootTarget: false
fail-fast: false
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
- id: get_tag_version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
shell: bash
- run: sudo apt-get install -y libunistring-dev libc6-dev-i386
if: runner.os == 'Linux'
- run: ./gradlew assemble
shell: bash
- run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository
env:
ORG_GRADLE_PROJECT_version: ${{ steps.get_tag_version.outputs.VERSION }}
ORG_GRADLE_PROJECT_targets: ${{ matrix.targets }}
ORG_GRADLE_PROJECT_publishRootTarget: ${{ matrix.publishRootTarget }}
ORG_GRADLE_PROJECT_ossrhUsername: ${{ secrets.OSSRH_USERNAME }}
ORG_GRADLE_PROJECT_ossrhPassword: ${{ secrets.OSSRH_PASSWORD }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_SECRET_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }}
shell: bash
release:
needs: publish
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}