refactor(pre-release): trying different things #9
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
on: | |
push: | |
branches: | |
- dev* | |
env: | |
CARGO_TERM_COLOR: always | |
permissions: | |
contents: write | |
discussions: write | |
jobs: | |
pre-release: | |
name: Nightly-release | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- target: x86_64-unknown-linux-musl | |
os: ubuntu-latest | |
cross: true | |
- target: aarch64-unknown-linux-musl | |
os: ubuntu-latest | |
cross: true | |
- target: armv7-unknown-linux-musleabi | |
os: ubuntu-latest | |
cross: true | |
- target: x86_64-apple-darwin | |
os: macos-latest | |
cross: false | |
- target: aarch64-apple-darwin | |
os: macos-latest | |
cross: false | |
- target: x86_64-pc-windows-msvc | |
os: windows-latest | |
cross: false | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/[email protected] | |
with: | |
target: ${{ matrix.target }} | |
- name: Run Cross | |
if: ${{ matrix.cross }} | |
run: | | |
cargo install cross --git https://github.com/cross-rs/cross.git --locked --rev 085092ca | |
cross build -p utpm --release --target ${{ matrix.target }} | |
- name: Run Cargo | |
if: ${{ !matrix.cross }} | |
run: | | |
cargo update -p cc --precise 1.0.83 | |
cargo build -p utpm --release --target ${{ matrix.target }} | |
- name: Create artifact directory | |
shell: bash | |
run: | | |
directory=utpm-${{ matrix.target }} | |
mkdir $directory | |
cp README.md LICENSE $directory | |
if [ -f target/${{ matrix.target }}/release/typst.exe ]; then | |
cp target/${{ matrix.target }}/release/typst.exe $directory | |
7z a -r $directory.zip $directory | |
else | |
cp target/${{ matrix.target }}/release/typst $directory | |
tar cJf $directory.tar.xz $directory | |
fi | |
- name: Create a Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
token: "${{ secrets.GITHUB_TOKEN }}" | |
prerelease: true | |
tag_name: ${{ github.sha }} | |
generate_release_notes: true | |
files: | | |
utpm-${{ matrix.target }}.* |