-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ci): Build marine and mrepl binaries for macos and linux (#279)
* chore(ci): Build marine and mrepl binaries for macos and linux * Exclude some shell lint rules * Typo
- Loading branch information
Showing
4 changed files
with
155 additions
and
20 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,126 @@ | ||
name: "Build binaries" | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
binary: | ||
description: "binary to build" | ||
type: string | ||
required: true | ||
tag: | ||
description: "tag name to upload binaries to" | ||
type: string | ||
required: true | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
linux: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- arch: x86_64 | ||
# - arch: aarch64 | ||
container: | ||
image: messense/rust-musl-cross:${{ matrix.arch }}-musl | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Build ${{ inputs.binary }} | ||
run: cargo build -p ${{ inputs.binary }} --release | ||
|
||
- name: Prepare binary for upload | ||
id: prepare | ||
env: | ||
BIN: "${{ inputs.binary }}-linux-${{ matrix.arch }}" | ||
run: | | ||
mv target/${{ matrix.arch }}-unknown-linux-musl/release/${{ inputs.binary }} ${BIN} | ||
echo "bin=${BIN}" >> $GITHUB_OUTPUT | ||
- name: Upload binary to checks | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ steps.prepare.outputs.bin }}-artifact | ||
path: ${{ steps.prepare.outputs.bin }} | ||
|
||
macos: | ||
runs-on: macos-12 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- arch: x86_64 | ||
env: | ||
CARGO_BUILD_TARGET: ${{ matrix.arch }}-apple-darwin | ||
MACOS_SDK: "macosx12.3" | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Prepare build variables | ||
run: | | ||
sudo xcode-select -switch /Applications/Xcode_13.4.1.app | ||
SDKROOT=$(xcrun -sdk ${{ env.MACOS_SDK }} --show-sdk-path) | ||
MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk ${{ env.MACOS_SDK }} --show-sdk-platform-version) | ||
echo "SDKROOT=${SKDROOT}" >> $GITHUB_ENV | ||
echo "MACOSX_DEPLOYMENT_TARGET=${SKDROOT}" >> $GITHUB_ENV | ||
- name: Setup rust toolchain | ||
uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
|
||
- name: Build ${{ inputs.binary }} | ||
run: cargo build -p ${{ inputs.binary }} --release | ||
|
||
- name: Prepare binary for upload | ||
id: prepare | ||
env: | ||
BIN: "${{ inputs.binary }}-darwin-${{ matrix.arch }}" | ||
run: | | ||
mv target/${{ matrix.arch }}-apple-darwin/release/${{ inputs.binary }} ${BIN} | ||
echo "bin=${BIN}" >> $GITHUB_OUTPUT | ||
- name: Upload binary to checks | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ steps.prepare.outputs.bin }}-artifact | ||
path: ${{ steps.prepare.outputs.bin }} | ||
|
||
upload: | ||
name: "Upload ${{ inputs.binary }}" | ||
runs-on: ubuntu-latest | ||
needs: | ||
- linux | ||
- macos | ||
|
||
permissions: | ||
contents: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Download binaries | ||
uses: actions/download-artifact@v3 | ||
with: | ||
path: binaries/ | ||
|
||
- name: Generate checksums | ||
id: sum | ||
run: | | ||
ls -R | ||
mv */* . | ||
rmdir *-artifact | ||
sha256sum * | tee > ${{ inputs.binary }}_SHA256_SUMS | ||
working-directory: binaries | ||
|
||
- name: Upload binaries | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: | | ||
binaries/* | ||
tag_name: ${{ inputs.tag }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
[toolchain] | ||
channel = "nightly-2022-09-15" | ||
targets = [ "x86_64-unknown-linux-gnu", "x86_64-apple-darwin", "wasm32-wasi", "wasm32-unknown-unknown" ] | ||
targets = [ | ||
"x86_64-unknown-linux-gnu", | ||
"x86_64-unknown-linux-musl", | ||
"x86_64-apple-darwin", | ||
"wasm32-wasi", | ||
"wasm32-unknown-unknown", | ||
] |