-
Notifications
You must be signed in to change notification settings - Fork 6
126 lines (114 loc) · 3.58 KB
/
main.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
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: Nar
on:
workflow_dispatch:
# trigger this workflow on push of a release tag
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+' # Push events to matching release tags, i.e. 0.8.4
jobs:
build-macos:
name: Build on macOS
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- macos-11 # x86_64
# - macos-13-xlarge # aarch64 (not free)
steps:
- uses: actions/checkout@v2
- name: Install build dependencies
run: |
brew update
brew install automake autoconf libtool
- uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '8'
cache: 'maven'
- name: Build and test the package
run: make compile-macosx
- name: Store the build arctifacts
uses: actions/upload-artifact@v3
with:
name: macos-build
path: target/nar/louis-*
build-windows:
name: Build for Windows
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '8'
cache: 'maven'
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install texinfo libc6-dev-i386 mingw-w64
- name: Build and test the package for x86_64
run: mvn test -Pcross-compile -Dhost.os=w64-mingw32 -Dos.arch=x86_64
- name: Build and test the package for i686
run: mvn test -Pcross-compile -Dhost.os=w64-mingw32 -Dos.arch=i686
- name: Store the build arctifacts
uses: actions/upload-artifact@v3
with:
name: windows-build
path: target/nar/louis-*
build-linux:
name: Build for Linux
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '8'
cache: 'maven'
- name: Build and test the package
run: mvn test
- name: Install i386 build dependencies
run: |
sudo apt-get update
sudo apt-get install libc6-dev-i386
- name: Build and test the package for i386
run: mvn test -Dos.arch=i386
- name: Store the build arctifacts
uses: actions/upload-artifact@v3
with:
name: linux-build
path: target/nar/louis-*
nar:
name: Package nar and publish
needs: [build-macos, build-windows, build-linux]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v3
with:
name: windows-build
path: target/nar
- uses: actions/download-artifact@v3
with:
name: macos-build
path: target/nar
- uses: actions/download-artifact@v3
with:
name: linux-build
path: target/nar
- uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '8'
cache: 'maven'
server-id: sonatype-nexus-staging
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Build the nar and publish
run: mvn --batch-mode nar:nar-prepare-package nar:nar-package jar:jar gpg:sign org.sonatype.plugins:nexus-staging-maven-plugin:1.6.8:deploy -DnexusUrl=https://oss.sonatype.org/ -DserverId=sonatype-nexus-staging -DkeepStagingRepositoryOnCloseRuleFailure=true
env:
MAVEN_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.SONATYPE_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}