-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #282 from Concordium/release-workflow
Release workflow
- Loading branch information
Showing
4 changed files
with
183 additions
and
2 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,150 @@ | ||
# Workflow for release a jar file with all native dependencies embedded. | ||
# The workflow runs whenever a release is published. | ||
|
||
name: Release | ||
|
||
on: | ||
release: | ||
types: [published] | ||
workflow_dispatch: # allow manual trigger | ||
|
||
env: | ||
dummy: 2 # change to force cache invalidation | ||
CARGO_TERM_COLOR: always # implicitly adds '--color=always' to all cargo commands | ||
|
||
jobs: | ||
build-native-ubuntu: | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
# Setup rust | ||
- name: Setup Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: 1.69 | ||
|
||
# Checkout the code | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Make ubuntu native depencies | ||
run: make | ||
|
||
- name: Upload linux library | ||
uses: actions/upload-artifact@master | ||
with: | ||
name: ubuntu-library | ||
path: ./concordium-sdk/native/libcrypto_jni.so | ||
|
||
build-native-macos: | ||
runs-on: macos-latest | ||
|
||
steps: | ||
# Setup rust | ||
- name: Setup Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: 1.69 | ||
|
||
# Checkout the code | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Make macos native depencies | ||
run: make | ||
|
||
- name: Upload macos library | ||
uses: actions/upload-artifact@master | ||
with: | ||
name: macos-library | ||
path: ./concordium-sdk/native/libcrypto_jni.dylib | ||
|
||
build-native-windows: | ||
runs-on: windows-latest | ||
|
||
steps: | ||
# Setup rust | ||
- name: Setup Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: 1.69 | ||
|
||
# Checkout the code | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Make windows native depencies | ||
run: cd crypto-jni && cargo build --release | ||
|
||
- name: Upload windows library | ||
uses: actions/upload-artifact@master | ||
with: | ||
name: windows-library | ||
path: crypto-jni\target\release\crypto_jni.dll | ||
|
||
build-and-release-jar: | ||
needs: [build-native-ubuntu, build-native-macos, build-native-windows] | ||
# Use fixed OS version because we install packages on the system. | ||
runs-on: ubuntu-22.04 | ||
|
||
if: ${{ !github.event.pull_request.draft }} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Setup JDK 8 | ||
uses: actions/setup-java@v2 | ||
with: | ||
java-version: 8 | ||
distribution: 'adopt' | ||
cache: maven | ||
|
||
- name: Download linux library | ||
uses: actions/download-artifact@master | ||
with: | ||
name: ubuntu-library | ||
path: concordium-sdk/native | ||
|
||
- name: Download macos library | ||
uses: actions/download-artifact@master | ||
with: | ||
name: macos-library | ||
path: concordium-sdk/native | ||
|
||
- name: Download windows library | ||
uses: actions/download-artifact@master | ||
with: | ||
name: windows-library | ||
path: concordium-sdk/native | ||
|
||
# Builds and tests the sdk. Delomboks code and generates a javadoc jar from the delombok'ed code | ||
- name: Build and test sdk | ||
run: cd concordium-sdk && mvn --batch-mode --update-snapshots install && mvn lombok:delombok -f pom.xml && mvn javadoc:jar -f pom.xml | ||
|
||
# Attach jar files to release (jar, jar-with-dependencies and javadoc-jar) | ||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: concordium-sdk/target/*.jar | ||
|
||
- name: Deploy javadoc | ||
uses: MathieuSoysal/[email protected] | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
javadoc-branch: javadoc | ||
java-version: 8 | ||
target-folder: javadoc # url will be https://concordium.github.io/concordium-java-sdk/javadoc/concordium-sdk/apidocs/ | ||
subdirectories: ./concordium-sdk | ||
without-checkout: true | ||
project: maven | ||
custom-command: cd concordium-sdk && mvn javadoc:javadoc -f pom.xml # Generates javadoc from the delombok'ed code | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
*.iml | ||
/target | ||
/native/* | ||
|
||
/delombok |
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
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