-
Notifications
You must be signed in to change notification settings - Fork 11
115 lines (107 loc) · 3.6 KB
/
build.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
name: Build
on:
push:
tags: [ 'v*' ]
branches: [ 'master' ]
pull_request:
branches: [ 'master' ]
jobs:
build:
name: Compile, test, check formatting
timeout-minutes: 15
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'ci skip')"
steps:
- uses: actions/checkout@v4
- uses: bleep-build/bleep-setup-action@0.0.1
- uses: coursier/cache-action@v6
with:
extraFiles: bleep.yaml
- name: Scalafmt Check
run: bleep fmt --check
- name: Run tests
run: |
bleep compile
bleep test
build-native:
name: Build JNI library on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-20.04
jni-folder: .bleep/generated-resources/crossterm/tui.scripts.GenJniLibrary
- os: macos-latest
jni-folder: .bleep/generated-resources/crossterm/tui.scripts.GenJniLibrary
- os: macOS-m1
jni-folder: .bleep/generated-resources/crossterm/tui.scripts.GenJniLibrary
- os: windows-latest
jni-folder: .bleep\generated-resources\crossterm\tui.scripts.GenJniLibrary
steps:
- uses: actions/checkout@v4
- uses: bleep-build/bleep-setup-action@0.0.1
- uses: coursier/cache-action@v6
with:
extraFiles: bleep.yaml
- name: Set up cargo cache
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: v1-${{ runner.arch }}-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.arch }}-${{ runner.os }}-cargo-
- name: Test jni library
run: bleep run demo@jvm3 check
if: runner.os != 'Windows'
- name: Test jni library (windows)
run: bleep run demo@jvm3 check
shell: cmd
if: runner.os == 'Windows'
- name: Temporarily save package
uses: actions/upload-artifact@v3
with:
name: tui.scripts.GenJniLibrary
path: ${{ matrix.jni-folder }}
retention-days: 1
publish:
timeout-minutes: 15
runs-on: ubuntu-latest
needs: [ build, build-native ]
if: "startsWith(github.ref, 'refs/tags/v')"
steps:
- uses: actions/checkout@v4
- uses: bleep-build/bleep-setup-action@0.0.1
- id: get_version
uses: battila7/get-version-action@v2
- name: Download artifacts
uses: actions/download-artifact@v3
with:
path: .bleep/generated-resources/crossterm/
- name: Display structure of downloaded files
run: find .bleep/generated-resources/crossterm
# next two tasks are optimization to avoid compiling rust code again
- name: load build
run: bleep projects
- name: touch all downloaded files (for newer timestamp)
run: find .bleep/generated-resources/crossterm | xargs touch
- name: Release
run: bleep publish
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
- name: Upload-to-release
uses: softprops/action-gh-release@v1
with:
name: "${{ steps.get_version.outputs.version-without-v }}"
prerelease: false
generate_release_notes: true
files: |