-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Chore/simplify Github Actions scripts (#200)
* chore: set dependency versions * chore: parameterize native-image-musl
- Loading branch information
1 parent
f3a4064
commit fb34586
Showing
2 changed files
with
51 additions
and
42 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 |
---|---|---|
|
@@ -11,6 +11,9 @@ env: | |
LMGREP_FEATURE_CHARSETS: true | ||
LMGREP_FEATURE_STEMPEL: true | ||
LMGREP_FEATURE_RAUDIKKO: false | ||
CLOJURE_VERSION: '1.11.1.1155' | ||
BABASHKA_VERSION: '0.9.161' | ||
GRAALVM_VERSION: '22.2.0' | ||
|
||
jobs: | ||
create-gh-release: | ||
|
@@ -44,20 +47,20 @@ jobs: | |
- uses: actions/[email protected] | ||
- uses: graalvm/setup-graalvm@v1 | ||
with: | ||
version: '22.2.0' | ||
version: ${{ env.GRAALVM_VERSION }} | ||
java-version: '17' | ||
components: 'native-image' | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Install clojure tools-deps` | ||
uses: DeLaGuardo/setup-clojure@master | ||
with: | ||
cli: 1.11.1.1155 | ||
cli: ${{ env.CLOJURE_VERSION }} | ||
|
||
- name: Setup Babashka | ||
uses: turtlequeue/[email protected] | ||
with: | ||
babashka-version: 0.9.161 | ||
babashka-version: ${{ env.BABASHKA_VERSION }} | ||
|
||
- name: Compile uberjar | ||
run: | | ||
|
@@ -92,34 +95,54 @@ jobs: | |
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ ubuntu-latest, macos-latest, windows-latest ] | ||
os: [ | ||
ubuntu-latest, | ||
ubuntu-20.04, | ||
macos-latest, | ||
windows-latest | ||
] | ||
include: | ||
- os: ubuntu-latest | ||
platform: linux | ||
gu-binary: gu | ||
arch: 'amd64' | ||
native-image-musl: 'false' | ||
static-suffix: '' | ||
- os: ubuntu-20.04 | ||
platform: linux | ||
gu-binary: gu | ||
arch: 'amd64' | ||
native-image-musl: 'true' | ||
static-suffix: '-static' | ||
- os: macos-latest | ||
platform: macos | ||
gu-binary: gu | ||
arch: 'amd64' | ||
native-image-musl: 'false' | ||
static-suffix: '' | ||
- os: windows-latest | ||
platform: windows | ||
gu-binary: gu.exe | ||
arch: 'amd64' | ||
native-image-musl: 'false' | ||
static-suffix: '' | ||
- os: self-hosted | ||
platform: macos | ||
gu-binary: gu | ||
arch: 'aarch64' | ||
native-image-musl: 'false' | ||
static-suffix: '' | ||
steps: | ||
- name: Set env variable with the release version | ||
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | ||
|
||
- uses: actions/[email protected] | ||
- uses: graalvm/setup-graalvm@v1 | ||
with: | ||
version: '22.2.0' | ||
version: ${{ env.GRAALVM_VERSION }} | ||
java-version: '17' | ||
components: 'native-image' | ||
native-image-musl: ${{ matrix.native-image-musl }} | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Download uberjar from job 'build-uberjar-upload-to-release-and-store-artifacts' | ||
|
@@ -128,9 +151,12 @@ jobs: | |
name: uberjar | ||
|
||
- name: Build native-image on *nix | ||
env: | ||
LMGREP_STATIC: ${{ matrix.native-image-musl }} | ||
LMGREP_MUSL: ${{ matrix.native-image-musl }} | ||
run: | | ||
./script/compile | ||
zip lmgrep-${RELEASE_VERSION}-${{ matrix.platform }}-${{ matrix.arch }}.zip lmgrep | ||
zip lmgrep-${RELEASE_VERSION}-${{ matrix.platform }}-${{ matrix.arch }}${{ matrix.static-suffix }}.zip lmgrep | ||
if: runner.os != 'Windows' | ||
|
||
- name: Build native-image on Windows and zip it | ||
|
@@ -146,47 +172,26 @@ jobs: | |
name: Release ${{ env.RELEASE_VERSION }} | ||
draft: true | ||
files: | | ||
lmgrep-*-${{ matrix.platform }}-${{ matrix.arch }}.zip | ||
lmgrep-*-${{ matrix.platform }}-${{ matrix.arch }}${{ matrix.static-suffix }}.zip | ||
build-native-image-with-musl: | ||
needs: [create-gh-release, build-uberjar-upload-to-release-and-store-artifacts] | ||
name: native-image-musl on ubuntu-latest | ||
- name: Archive static native images as artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: static-image | ||
path: lmgrep | ||
if: matrix.native-image-musl == 'true' | ||
|
||
docker-image-release: | ||
needs: [ create-gh-release, build-uberjar-upload-to-release-and-store-artifacts, build-native-executables-and-upload-to-release ] | ||
name: docker image release per architecture | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set env variable with the release version | ||
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | ||
|
||
- uses: actions/[email protected] | ||
- name: Run setup-graalvm action | ||
uses: graalvm/setup-graalvm@v1 | ||
with: | ||
version: '22.2.0' | ||
java-version: '17' | ||
components: 'native-image' | ||
native-image-musl: 'true' | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Download uberjar from job 'build-uberjar-upload-to-release-and-store-artifacts' | ||
- name: Download uberjar from job 'build-native-executables-and-upload-to-release' | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: uberjar | ||
|
||
- name: Build static lmgrep image with Native Image and musl | ||
env: | ||
LMGREP_STATIC: true | ||
LMGREP_MUSL: true | ||
run: | | ||
./script/compile | ||
zip lmgrep-${RELEASE_VERSION}-linux-amd64-static.zip lmgrep | ||
- name: Upload ziped binary to the release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
tag_name: ${{ env.RELEASE_VERSION }} | ||
name: Release ${{ env.RELEASE_VERSION }} | ||
draft: true | ||
files: | | ||
lmgrep-*-linux-amd64-static.zip | ||
name: static-image | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
|
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 |
---|---|---|
|
@@ -3,6 +3,10 @@ name: Tests | |
on: | ||
push: | ||
|
||
env: | ||
CLOJURE_VERSION: '1.11.1.1155' | ||
BABASHKA_VERSION: '0.9.161' | ||
|
||
jobs: | ||
unit-test: | ||
|
||
|
@@ -27,12 +31,12 @@ jobs: | |
- name: Install clojure tools-deps | ||
uses: DeLaGuardo/setup-clojure@master | ||
with: | ||
tools-deps: 1.11.1.1155 | ||
cli: ${{ env.CLOJURE_VERSION }} | ||
|
||
- name: Setup Babashka | ||
uses: turtlequeue/[email protected] | ||
with: | ||
babashka-version: 0.9.161 | ||
babashka-version: ${{ env.BABASHKA_VERSION }} | ||
|
||
- name: Unit Tests | ||
env: | ||
|