Fix double-v #42
Workflow file for this run
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: | |
- "*" | |
branches: | |
- "fix-releases" | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
build: | |
name: Release binary for ${{ matrix.name }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: ubuntu-latest | |
name: linux | |
target_dir: target/x86_64-unknown-linux-musl/release/ | |
asset_name: idl2json_cli-x86_64-unknown-linux-musl.tar.gz | |
old_name: idl2json-linux-x86_64.tar.gz | |
make_target: musl-static | |
build: musl | |
pack: tar | |
# - os: windows-latest | |
# name: windows | |
# target_dir: target/release/ | |
# asset_name: idl2json-windows-x86_64 | |
# make_target: release | |
# rust: 1.60.0 | |
- os: macos-latest | |
name: macos | |
target_dir: target/release/ | |
asset_name: idl2json_cli-x86_64-apple-darwin.zip | |
old_name: idl2json-macos-x86_64.zip | |
make_target: release | |
rust: 1.60.0 | |
build: cargo | |
pack: zip | |
# - os: ubuntu-latest | |
# name: arm | |
# target_file: target/arm-unknown-linux-gnueabihf/release/{idl2json,yaml2candid} | |
# asset_name: idl2json-arm_32 | |
# make_target: unused | |
# rust: 1.60.0 | |
steps: | |
- name: Stop, we are just testing | |
run: false | |
- uses: actions/checkout@v3 | |
# BUILD | |
- name: Static build with musl | |
if: matrix.build == 'musl' | |
uses: mariodfinity/rust-musl-action@master | |
with: | |
args: make ${{ matrix.make_target }} | |
- name: Install toolchain (ARM) | |
if: matrix.name == 'arm' | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: ${{ matrix.rust }} | |
override: true | |
target: arm-unknown-linux-gnueabihf | |
- name: Build with cargo | |
if: matrix.build == 'cargo' | |
run: make ${{ matrix.make_target }} | |
- name: Cross build | |
if: matrix.name == 'arm' | |
uses: actions-rs/cargo@v1 | |
with: | |
use-cross: true | |
command: build | |
args: --target arm-unknown-linux-gnueabihf --features static-ssl --release --locked | |
# ZIP | |
- name: tar the results | |
if: matrix.pack == 'tar' | |
run: | | |
tar -C "${{ matrix.target_dir }}" -czvf "$PWD/${{ matrix.asset_name }}" idl2json yaml2candid | |
- name: zip the results | |
if: matrix.pack == 'zip' | |
run: | | |
zipfile="$PWD/${{ matrix.asset_name }}" | |
cd "${{ matrix.target_dir }}" | |
zip "$zipfile" idl2json yaml2candid | |
- name: Support the old download location | |
run: cp "${{ matrix.asset_name }}" "${{ matrix.old_name }}" | |
# UPLOAD | |
- name: Upload binaries to release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: "${{ matrix.asset_name }}" | |
tag: "${{ github.ref }}" | |
publish_idl2json: | |
needs: build | |
name: Publish idl2json to crates.io | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- package: idl2json | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Publish ${{ matrix.package }} | |
env: | |
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
run: cargo publish -p "${{ matrix.package }}" | |
publish_idl2json_cli: | |
needs: publish_idl2json | |
name: Publish idl2json_cli to crates.io | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- package: idl2json_cli | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Publish ${{ matrix.package }} | |
env: | |
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
run: cargo publish -p "${{ matrix.package }}" |