-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bleep can now build and publish Bleep! 🎆
- drops sbt build - new publishing scheme for compiled binaries - publish bleep-cli to maven so coursier can provide a slow version for non-common platforms
- Loading branch information
1 parent
f022ac3
commit 509d556
Showing
13 changed files
with
187 additions
and
291 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 |
---|---|---|
@@ -1,13 +1,16 @@ | ||
#!/bin/bash | ||
mkdir -p work/release | ||
chmod 755 artifacts/linux-binary/bleep-linux | ||
chmod 755 artifacts/macos-binary/bleep-macos | ||
|
||
mv artifacts/linux-binary/bleep-linux "work/release/bleep-$VERSION-x86-64-pc-linux" | ||
mv artifacts/macos-binary/bleep-macos "work/release/bleep-$VERSION-x86-64-apple-darwin" | ||
mv artifacts/windows-binary/bleep-windows.exe artifacts/windows-binary/bleep.exe | ||
set -e | ||
|
||
mkdir -p work/release | ||
|
||
gzip "work/release/bleep-$VERSION-x86-64-pc-linux" | ||
gzip "work/release/bleep-$VERSION-x86-64-apple-darwin" | ||
CWD=$(pwd -P) | ||
(cd artifacts/windows-binary && zip -r "$CWD/work/release/bleep-$VERSION-x86-64-pc-win32.zip" *.exe) | ||
|
||
chmod +x artifacts/bleep-x86_64-pc-linux/bleep | ||
(cd artifacts/bleep-x86_64-pc-linux && tar cvfz "$CWD/work/release/bleep-x86_64-pc-linux.tar.gz" bleep) | ||
|
||
chmod +x artifacts/bleep-x86_64-apple-darwin/bleep | ||
(cd artifacts/bleep-x86_64-apple-darwin && tar cvfz "$CWD/work/release/bleep-x86_64-apple-darwin.tar.gz" bleep) | ||
|
||
(cd artifacts/bleep-x86_64-pc-win32 && zip -r "$CWD/work/release/bleep-x86_64-pc-win32.zip" bleep.exe) | ||
|
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 |
---|---|---|
|
@@ -15,122 +15,107 @@ jobs: | |
- uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
- uses: graalvm/setup-graalvm@v1 | ||
with: | ||
version: '22.1.0' | ||
java-version: '17' | ||
components: 'native-image' | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
- uses: coursier/setup-action@v1 | ||
- uses: coursier/[email protected] | ||
with: | ||
apps: sbt | ||
apps: scalafmt | ||
- uses: coursier/cache-action@v6 | ||
- name: Scalafmt Check | ||
if: ${{ matrix.os != 'windows-latest' }} | ||
shell: bash | ||
run: sbt --client scalafmtCheckAll | ||
- name: "Test" | ||
shell: bash | ||
run: sbt --client "test" | ||
- name: "Assembly" | ||
shell: bash | ||
run: sbt --client "bleep-cli/assembly" | ||
- name: Temporarily save package | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: java-binary | ||
path: | | ||
${{ github.workspace }}/bleep-cli/target/jvm-2.13/bleep-cli-assembly.jar | ||
retention-days: 1 | ||
- name: Cleanup before cache | ||
shell: bash | ||
extraFiles: bleep.yaml | ||
|
||
- name: Scalafmt Check | ||
run: scalafmt -c .scalafmt.conf --check | ||
|
||
- name: Install bleep stable | ||
run: cs install --channel channel bleep:0.0.1-M7 --verbose | ||
|
||
- name: Run tests | ||
run: | | ||
rm -rf "$HOME/.ivy2/local" || true | ||
find $HOME/Library/Caches/Coursier/v1 -name "ivydata-*.properties" -delete || true | ||
find $HOME/.ivy2/cache -name "ivydata-*.properties" -delete || true | ||
find $HOME/.cache/coursier/v1 -name "ivydata-*.properties" -delete || true | ||
find $HOME/.sbt -name "*.lock" -delete || true | ||
bleep generate-resources | ||
bleep test | ||
build-native-image: | ||
name: Native image build on ${{ matrix.os }} | ||
needs: [ build ] | ||
runs-on: ${{ matrix.os }} | ||
timeout-minutes: 20 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- os: ubuntu-latest | ||
file_name: bleep-linux | ||
artifact_name: linux-binary | ||
file_name: bleep | ||
artifact_name: bleep-x86_64-pc-linux | ||
- os: macos-latest | ||
file_name: bleep-macos | ||
artifact_name: macos-binary | ||
file_name: bleep | ||
artifact_name: bleep-x86_64-apple-darwin | ||
- os: windows-latest | ||
file_name: bleep-windows | ||
artifact_name: windows-binary | ||
file_name: bleep.exe | ||
artifact_name: bleep-x86_64-pc-win32 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
- name: Download application package | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: java-binary | ||
- uses: graalvm/setup-graalvm@v1 | ||
with: | ||
version: '22.1.0' | ||
java-version: '17' | ||
components: 'native-image' | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
- uses: coursier/[email protected] | ||
- uses: coursier/cache-action@v6 | ||
with: | ||
extraFiles: bleep.yaml | ||
|
||
- name: Build native image on Linux | ||
run: mkdir dist && native-image --enable-url-protocols=https -jar bleep-*.jar dist/${{ matrix.file_name }} && chmod 755 dist/${{ matrix.file_name }} | ||
if: runner.os == 'Linux' | ||
- name: Install bleep stable | ||
run: cs install --channel channel bleep:0.0.1-M7 --verbose | ||
|
||
- name: Build native image on Mac OS X | ||
run: mkdir dist && native-image --enable-url-protocols=https -jar bleep-*.jar dist/${{ matrix.file_name }} && chmod 755 dist/${{ matrix.file_name }} | ||
if: runner.os == 'macOS' | ||
- name: Build native image (non-windows) | ||
# todo: output should be parameter to native-image after next release | ||
run: | | ||
bleep generate-resources | ||
bleep native-image | ||
mv bleep-cli/target/native-image/bleep-cli ./${{ matrix.file_name }} | ||
if: runner.os != 'Windows' | ||
|
||
- name: Test binary after build (non-windows) | ||
run: ./${{ matrix.file_name }} --ignore-version-in-build-file test --no-color jvm213 | ||
if: runner.os != 'Windows' | ||
|
||
- name: Build native image on Windows | ||
run: >- | ||
mkdir dist && "C:\Program Files (x86)\Microsoft Visual | ||
Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" && native-image --native-image-info --verbose --enable-url-protocols=https -jar bleep-*.jar dist/${{ matrix.file_name }} | ||
- name: generate resources (windows) | ||
# note: yaml multiline syntax doesn't seem to work (cmd only runs first command). | ||
# that's why this is split in generate resources and build native image below | ||
run: bleep generate-resources | ||
# shell is important here. default is powershell and things do not work there | ||
# see https://github.com/dirs-dev/directories-jvm/issues/49 | ||
shell: cmd | ||
if: runner.os == 'Windows' | ||
|
||
- name: Test binary after build on Windows | ||
- name: Build native image (windows) | ||
# todo: output should be parameter to native-image after next release | ||
run: bleep native-image | ||
shell: cmd | ||
run: | | ||
.\dist\${{ matrix.file_name }}.exe --ignore-version-in-build-file generate-resources | ||
.\dist\${{ matrix.file_name }}.exe --ignore-version-in-build-file compile --no-color jvm213 | ||
if: runner.os == 'Windows' | ||
|
||
- name: Test binary after build on Linux | ||
run: | | ||
chmod 755 dist/${{ matrix.file_name }} | ||
./dist/${{ matrix.file_name }} --ignore-version-in-build-file generate-resources | ||
./dist/${{ matrix.file_name }} --ignore-version-in-build-file compile --no-color jvm213 | ||
if: runner.os == 'Linux' | ||
- name: Rename native image (windows) | ||
run: move bleep-cli\target\native-image\bleep-cli.exe ${{ matrix.file_name }} | ||
shell: cmd | ||
if: runner.os == 'Windows' | ||
|
||
- name: Test binary after build on Macos | ||
run: | | ||
chmod 755 dist/${{ matrix.file_name }} | ||
./dist/${{ matrix.file_name }} --ignore-version-in-build-file generate-resources | ||
./dist/${{ matrix.file_name }} --ignore-version-in-build-file compile --no-color jvm213 | ||
if: runner.os == 'macOS' | ||
- name: Test binary after build (windows) | ||
shell: cmd | ||
# todo: fix tests on windows | ||
run: .\${{ matrix.file_name }} --ignore-version-in-build-file compile --no-color jvm213 | ||
if: runner.os == 'Windows' | ||
|
||
- name: Temporarily save package | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: ${{ matrix.artifact_name }} | ||
path: | | ||
dist/bleep-* | ||
path: ${{ matrix.file_name }} | ||
retention-days: 1 | ||
|
||
release: | ||
timeout-minutes: 15 | ||
runs-on: ubuntu-latest | ||
needs: [ build-native-image ] | ||
needs: [ build, build-native-image ] | ||
if: "startsWith(github.ref, 'refs/tags/v')" | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
@@ -144,20 +129,12 @@ jobs: | |
path: artifacts | ||
- name: Display structure of downloaded files | ||
run: find artifacts | ||
- uses: graalvm/setup-graalvm@v1 | ||
with: | ||
version: '22.1.0' | ||
java-version: '17' | ||
components: 'native-image' | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Release | ||
run: | | ||
chmod +x ./artifacts/linux-binary/bleep-linux | ||
./artifacts/linux-binary/bleep-linux generate-resources | ||
./artifacts/linux-binary/bleep-linux publish | ||
chmod +x ./artifacts/bleep-x86_64-pc-linux/bleep | ||
./artifacts/bleep-x86_64-pc-linux/bleep generate-resources | ||
./artifacts/bleep-x86_64-pc-linux/bleep publish | ||
env: | ||
CI_RELEASE: ${{ secrets.CI_RELEASE }} | ||
CI_SNAPSHOT_RELEASE: ${{ secrets.CI_SNAPSHOT_RELEASE }} | ||
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} | ||
PGP_SECRET: ${{ secrets.PGP_SECRET }} | ||
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | ||
|
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
79 changes: 55 additions & 24 deletions
79
bleep-cli/src/main/scala/bleep/internal/FetchBleepRelease.scala
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
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
Oops, something went wrong.