Skip to content

Merge pull request #23 from piyoppi/list-scheduled-items #45

Merge pull request #23 from piyoppi/list-scheduled-items

Merge pull request #23 from piyoppi/list-scheduled-items #45

Workflow file for this run

name: Release
on:
push:
branches:
- main
tags:
- 'v*.*.*'
jobs:
build:
strategy:
matrix:
target:
- os: windows-latest
target: x86_64-pc-windows-msvc
name: windows-x86_64
- os: windows-latest
target: aarch64-pc-windows-msvc
name: windows-arm64
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
name: linux-x86_64-musl
- os: ubuntu-latest
target: aarch64-unknown-linux-musl
name: linux-arm64-musl
- os: macos-latest
target: x86_64-apple-darwin
name: darwin-x86_64
- os: macos-latest
target: aarch64-apple-darwin
name: darwin-arm64
name: Build ${{ matrix.target.name }}
runs-on: ${{ matrix.target.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install cross-compilation tools
uses: taiki-e/setup-cross-toolchain-action@v1
with:
target: ${{ matrix.target.target }}
- name: Build
run: |
rustup target add ${{ matrix.target.target }}
cargo build --release --target ${{ matrix.target.target }}
- name: compress
if: matrix.target.os != 'windows-latest'
run: |
mv target/${{ matrix.target.target }}/release/chiritori .
tar -czf chiritori-${{ matrix.target.name }}.tar.gz ./chiritori
- name: compress
if: matrix.target.os == 'windows-latest'
run: |
mv target/${{ matrix.target.target }}/release/chiritori.exe .
7z a chiritori-${{ matrix.target.name }}.zip ./chiritori.exe
- name: Upload Release Asset
if: matrix.target.os != 'windows-latest'
uses: actions/upload-artifact@v4
with:
name: chiritori-${{ matrix.target.name }}
if-no-files-found: error
path: |
chiritori-${{ matrix.target.name }}.tar.gz
- name: Upload Release Asset
if: matrix.target.os == 'windows-latest'
uses: actions/upload-artifact@v4
with:
name: chiritori-${{ matrix.target.name }}
if-no-files-found: error
path: |
chiritori-${{ matrix.target.name }}.zip
release:
needs:
- build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
merge-multiple: true
- name: Create Release (nightly)
uses: softprops/action-gh-release@v1
with:
tag_name: nightly
draft: true
prerelease: true
files: chiritori-*
- name: Create Release (Release)
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, '-alpha') && !contains(github.ref, '-beta')
with:
tag_name: ${{ github.ref }}
files: chiritori-*
- name: Create Release (Prerelease)
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/v') && (contains(github.ref, '-alpha') || contains(github.ref, '-beta'))
with:
tag_name: ${{ github.ref }}
files: chiritori-*
prerelease: true