Skip to content

Commit

Permalink
ci
Browse files Browse the repository at this point in the history
  • Loading branch information
ahaoboy committed Oct 19, 2024
1 parent 898eddc commit 700fdee
Showing 1 changed file with 43 additions and 7 deletions.
50 changes: 43 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,19 @@ name: Release
permissions:
contents: write

on:
push:
tags:
- v[0-9]+.*
on: [push]

defaults:
run:
shell: bash --noprofile --norc -CeEuo pipefail {0}

jobs:
create-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: taiki-e/create-gh-release-action@v1
if: startsWith(github.ref, 'refs/tags/')
with:
token: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -21,24 +24,57 @@ jobs:
strategy:
matrix:
include:
- target: x86_64-unknown-linux-musl
os: ubuntu-latest
- target: x86_64-apple-darwin
os: macos-latest
- target: aarch64-apple-darwin
os: macos-latest
- target: x86_64-pc-windows-msvc
os: windows-latest
RUSTFLAGS: -C target-feature=+crt-static
- target: x86_64-pc-windows-gnu
os: windows-latest
- target: arm64ec-pc-windows-msvc
os: windows-latest
- target: aarch64-unknown-linux-musl
os: ubuntu-latest
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
- target: x86_64-unknown-linux-musl
os: ubuntu-latest
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
# - uses: actions-rust-lang/setup-rust-toolchain@v1
# with:
# rustflags: "-A warnings"
# toolchain: "nightly"
- uses: taiki-e/upload-rust-binary-action@v1
with:
dry-run: ${{ !startsWith(github.ref, 'refs/tags/') }}
bin: osvg
target: ${{ matrix.target }}
token: ${{ secrets.GITHUB_TOKEN }}
# ref: refs/tags/dummy
ref: ${{ startsWith(github.ref, 'refs/tags/') && github.ref || 'refs/tags/dummy' }}
features: cli
env:
RUSTFLAGS: ${{ matrix.RUSTFLAGS }}
RUSTFLAGS: ${{ matrix.RUSTFLAGS }}
- name: Get target name for artifact
id: artifact-target
run: |
target="${{ matrix.target }}"
if [[ -z "${target}" ]]; then
host=$(rustc -vV | grep -E '^host:' | cut -d' ' -f2)
printf '%s\n' "artifact-target=${host}" >>"${GITHUB_OUTPUT}"
elif [[ "${{ matrix.build-tool }}" == 'cargo-zigbuild' ]]; then
printf '%s\n' "artifact-target=${target%%.*}" >>"${GITHUB_OUTPUT}"
else
printf '%s\n' "artifact-target=${target}" >>"${GITHUB_OUTPUT}"
fi
# For debugging
- uses: actions/upload-artifact@v4
with:
name: osvg-${{ steps.artifact-target.outputs.artifact-target }}
path: osvg-${{ steps.artifact-target.outputs.artifact-target }}.*

0 comments on commit 700fdee

Please sign in to comment.