mmtc/.github/workflows/release.yml
dependabot[bot] a880ee7bb3
Bump actions/checkout from 3 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-05 08:49:44 +00:00

84 lines
2.1 KiB
YAML

name: release
on:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+
jobs:
create_release:
name: create_release
runs-on: ubuntu-latest
steps:
- name: Create release
uses: softprops/action-gh-release@v1
with:
body: "[Changelog](https://github.com/figsoda/mmtc/blob/main/CHANGELOG.md)"
release:
name: release
needs: create_release
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- target: x86_64-apple-darwin
os: macos-latest
- target: x86_64-pc-windows-gnu
os: windows-latest
ext: .exe
- target: x86_64-pc-windows-msvc
os: windows-latest
ext: .exe
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- target: x86_64-unknown-linux-musl
os: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cargo build
run: |
rustup toolchain install nightly --profile minimal -t ${{ matrix.target }}
cargo +nightly build --release --target ${{ matrix.target }}
env:
RUSTFLAGS: -C strip=symbols
- name: Upload asset
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ github.token }}
tag: ${{ github.ref }}
file: target/${{ matrix.target }}/release/mmtc${{ matrix.ext }}
asset_name: mmtc-${{ matrix.target }}${{ matrix.ext }}
artifacts:
name: artifacts
needs: create_release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cargo build
run: |
rustup toolchain install nightly --profile minimal
cargo +nightly build
env:
GEN_ARTIFACTS: artifacts
- name: Rename generated artifacts
run: |
mv artifacts/{_,}mmtc.ps1
mv artifacts/{_mmtc,mmtc.zsh}
- name: Upload artifacts
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ github.token }}
tag: ${{ github.ref }}
file: artifacts/*
file_glob: true