Skip to content

comment out for test #17

comment out for test

comment out for test #17

Workflow file for this run

name: Release
permissions:
contents: write
on:
push:
tags:
- "v*"
jobs:
build:
strategy:
matrix:
target:
# - x86_64-apple-darwin
# - aarch64-apple-darwin
# - x86_64-unknown-linux-gnu
# - aarch64-unknown-linux-gnu
# - x86_64-unknown-linux-musl
# - aarch64-unknown-linux-musl
- x86_64-pc-windows-msvc
- aarch64-pc-windows-msvc
include:
# - target: x86_64-apple-darwin
# os: macos-latest
# - target: aarch64-apple-darwin
# os: macos-latest
# - target: x86_64-unknown-linux-gnu
# os: ubuntu-20.04
# - target: aarch64-unknown-linux-gnu
# os: ubuntu-20.04
# - target: x86_64-unknown-linux-musl
# os: ubuntu-20.04
# - target: aarch64-unknown-linux-musl
# os: ubuntu-20.04
- target: x86_64-pc-windows-msvc
os: windows-2022
- target: aarch64-pc-windows-msvc
os: windows-2022
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
target: ${{ matrix.target }}
override: true
- name: Install arm64 toolchain
if: matrix.target == 'aarch64-unknown-linux-gnu'|| matrix.target == 'aarch64-unknown-linux-musl'
run: |
sudo apt-get update
sudo apt-get install -y gcc-aarch64-linux-gnu
- name: Install musl toolchain
if: matrix.target == 'x86_64-unknown-linux-musl' || matrix.target == 'aarch64-unknown-linux-musl'
run: |
sudo apt-get update
sudo apt-get install -y musl-tools
- uses: Swatinem/rust-cache@v1
- name: Build release version
run: cargo build --verbose --release --target=${{ matrix.target }}
- name: Copy CLI binary for Windows platform
if: matrix.os == 'windows-2022'
run: |
mkdir dist
cp target/${{ matrix.target }}/release/main.exe ./dist/main-${{ matrix.target }}.exe
- name: Copy CLI binary
if: matrix.os != 'windows-2022'
run: |
mkdir dist
cp target/${{ matrix.target }}/release/main ./dist/main-${{ matrix.target }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: main-${{ matrix.target }}
path: ./dist/main-*
if-no-files-found: error
release:
if: github.event_name != 'pull_request'
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
pattern: main-*
merge-multiple: true
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: main-*
fail_on_unmatched_files: true
generate_release_notes: true