Cannot build binary with musl. #19
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: release | |
on: | |
push: | |
tags: | |
- v* | |
branches: | |
- master | |
jobs: | |
test-pack-release: | |
runs-on: ubuntu-latest | |
name: Test, Pack and Release | |
steps: | |
- name: Fetch repository | |
uses: actions/checkout@master | |
with: | |
fetch-depth: 0 | |
# Setup Node.js 16 environment | |
- name: Setup Node.js 16 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '16' | |
- uses: bahmutov/npm-install@v1 | |
with: | |
useLockFile: false | |
working-directory: studio | |
- name: Build studio | |
run: cd studio && yarn openapi && yarn build:embed && cd .. | |
# Install musl-tools and build-essential | |
- name: Install musl-gcc and build-essential | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y musl-tools build-essential | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
target: x86_64-unknown-linux-musl | |
- name: Install musl target | |
run: rustup target add x86_64-unknown-linux-musl | |
- name: Configure environment | |
id: config | |
run: | | |
# VERSION=$(echo $GITHUB_REF | sed -e "s/^refs\/tags\/v//") | |
VERSION=$(git describe --tags --abbrev=0 | sed -e "s/v//") | |
sed -i "s/0.1.0/$VERSION/g" Cargo.toml | |
echo ::set-output name=version::$VERSION | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
args: --release --target=x86_64-unknown-linux-musl --all-features | |
- name: Move binary | |
run: mv target/x86_64-unknown-linux-musl/release/biominer-indexd target/release/biominer-indexd-v${{ steps.config.outputs.version }}-x86_64-linux-musl | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
args: --release --all-features | |
- name: Move binary | |
run: mv target/release/biominer-indexd target/release/biominer-indexd-v${{ steps.config.outputs.version }}-x86_64-linux | |
- name: Create a pre-release | |
id: pre_release | |
uses: marvinpinto/action-automatic-releases@latest | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
automatic_release_tag: "v${{ steps.config.outputs.version }}" | |
prerelease: true | |
title: "Pre-release v${{ steps.config.outputs.version }}" | |
files: | | |
LICENSE | |
target/release/biominer-indexd-v* | |
target/x86_64-unknown-linux-musl/release/biominer-indexd-v* | |
- name: Output | |
run: echo "${{steps.pre_release.outputs.automatic_releases_tag}}" |