forked from scala-cli/libsodiumjni
-
Notifications
You must be signed in to change notification settings - Fork 1
111 lines (108 loc) · 3.25 KB
/
ci.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
name: CI
on:
pull_request:
push:
branches:
- main
tags:
- "v*"
jobs:
test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- uses: coursier/[email protected]
- uses: coursier/[email protected]
with:
jvm: zulu:17
- name: Install libsodium (Linux)
if: runner.os == 'Linux'
run: sudo apt-get install -y libsodium-dev
- name: Update XCode version
if: runner.os == 'macOS'
# https://github.com/actions/virtual-environments/issues/2557
run: |
sudo xcode-select -s "/Applications/Xcode_12.5.app" || sudo xcode-select -s "/Applications/Xcode_12.3.app" || ( ls /Applications; exit 1 )
sudo rm -Rf /Library/Developer/CommandLineTools/SDKs/*
- name: Run tests
run: ./mill -i __.test
- name: Build and publish locally
run: ./mill -i __.publishLocal
- name: List published files
shell: bash
run: find ~/.ivy2/local | sort
- name: Copy artifacts
run: ./mill -i __.jniCopyFilesTo artifacts/
- uses: actions/[email protected]
with:
name: artifacts
path: artifacts/
if-no-files-found: error
retention-days: 2
test-m1:
runs-on: ARM64
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- uses: coursier/[email protected]
- uses: coursier/setup-action@f883d08305acbc28e5e5363bf5ec086397627021
with:
apps: ""
jvm: "https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.1.0/graalvm-ce-java17-darwin-aarch64-22.1.0.tar.gz"
- name: Run tests
run: ./mill -i __.test
- name: Build and publish locally
run: ./mill -i __.publishLocal
- name: List published files
shell: bash
run: find ~/.ivy2/local | sort
- name: Copy artifacts
run: ./mill -i __.jniCopyFilesTo artifacts/
- uses: actions/[email protected]
with:
name: artifacts
path: artifacts/
if-no-files-found: error
retention-days: 2
release:
needs: [test,test-m1]
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- uses: coursier/[email protected]
- uses: coursier/[email protected]
with:
jvm: zulu:17
- name: Install libsodium (Linux)
if: runner.os == 'Linux'
run: sudo apt-get install -y libsodium-dev
- uses: actions/download-artifact@v2
with:
name: artifacts
path: artifacts/
- run: .github/scripts/gpg-setup.sh
shell: bash
env:
PGP_SECRET: ${{ secrets.PGP_SECRET }}
- name: Release
run: ./mill -i publishSonatype __.publishArtifacts
env:
PGP_PASSWORD: ${{ secrets.PGP_PASSPHRASE }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}