-
Notifications
You must be signed in to change notification settings - Fork 18
86 lines (74 loc) · 2.8 KB
/
release.yaml
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
on: push
jobs:
build-and-upload:
name: build and upload
strategy:
matrix:
os: [macos, ubuntu]
include:
- os: ubuntu
runs: ubuntu-latest
artifact-name: sup-linux-amd
- os: macos
runs: macos-latest
artifact-name: sup-macos-amd
runs-on: ${{ matrix.runs }}
steps:
- name: checkout
uses: actions/checkout@v2
- uses: coursier/cache-action@v6
- name: test for ${{ matrix.os }}
run: |
./sbt test
- uses: olafurpg/setup-scala@v13
- run: sbt ci-release
if: ${{ matrix.os == 'macos' }}
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
- uses: graalvm/setup-graalvm@v1
if: ${{ startsWith(github.ref, 'refs/tags/') }}
with:
version: 'latest'
java-version: '17'
components: 'native-image'
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: build for ${{ matrix.os }}
if: ${{ startsWith(github.ref, 'refs/tags/') }}
run: |
./sbt graalvm-native-image:packageBin
# disable on window: https://github.com/upx/upx/issues/559
- name: run upx on ${{ matrix.os }}
uses: svenstaro/upx-action@v2
if: ${{ startsWith(github.ref, 'refs/tags/') }}
with:
file: target/graalvm-native-image/scala-update
args: --best --lzma
- name: upload ${{ matrix.os }}
uses: actions/upload-artifact@v2
if: ${{ startsWith(github.ref, 'refs/tags/') }}
with:
name: ${{ matrix.artifact-name }}
path: target/graalvm-native-image/scala-update
- name: release binaries
uses: svenstaro/upload-release-action@v2
if: ${{ startsWith(github.ref, 'refs/tags/') }}
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/graalvm-native-image/scala-update
asset_name: ${{ matrix.artifact-name }}
overwrite: true
tag: ${{ github.ref }}
- id: get_version
if: ${{ matrix.os == 'macos' && startsWith(github.ref, 'refs/tags/') }}
uses: battila7/get-version-action@v2
- name: bump homebrew formula
env:
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.HOMEBREW_GITHUB_TOKEN }}
if: ${{ matrix.os == 'macos' && startsWith(github.ref, 'refs/tags/') }}
run: |
brew tap kitlangton/tap
brew bump-formula-pr kitlangton/tap/scala-update -f --no-browse --no-audit \
--url="https://github.com/kitlangton/scala-update/releases/download/${{ steps.get_version.outputs.version }}/${{ matrix.artifact-name }}"