Bump actions/checkout from 3 to 4 (#53) #147
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | |