Skip to content

Merge pull request #42 from yuma140902/gha-release #15

Merge pull request #42 from yuma140902/gha-release

Merge pull request #42 from yuma140902/gha-release #15

Workflow file for this run

name: Release to GitHub and Crates.io
on:
push:
tags:
- 'v*.*.*'
branches:
- master
env:
# Disable incremental build
CARGO_INCREMENTAL: 0
PJ_NAME: tempura
jobs:
build:
name: Build for ${{ matrix.target }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- target: i686-unknown-linux-gnu
os: ubuntu-latest
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
- target: x86_64-unknown-linux-musl
os: ubuntu-latest
- target: i686-unknown-linux-musl
os: ubuntu-latest
- target: aarch64-unknown-linux-musl
os: ubuntu-latest
- target: x86_64-pc-windows-msvc
os: windows-latest
- target: i686-pc-windows-msvc
os: windows-latest
- target: x86_64-apple-darwin
os: macos-latest
- target: aarch64-apple-darwin
os: macos-latest
steps:
- name: Setup | Checkout
uses: actions/checkout@v3
- name: Setup | Rust Toolchain
uses: actions-rs/toolchain@v1.0.6
with:
toolchain: stable
target: ${{ matrix.target }}
override: true
- name: Build | Build
uses: actions-rs/cargo@v1.0.1
with:
command: build
args: --release --locked --target=${{ matrix.target }}
use-cross: ${{ matrix.os == 'ubuntu-latest' }}
- name: Post Build | Compress artifacts [-nix]
if: matrix.os != 'windows-latest'
run: |
cd target/${{ matrix.target }}/release
tar czvf ../../../${{ env.PJ_NAME }}-${{ matrix.target }}.tar.gz ${{ env.PJ_NAME }}
cd -
- name: Post Build | Compress artifacts [Windows]
if: matrix.os == 'windows-latest'
run: |
cd target/${{ matrix.target }}/release
7z a ../../../${{ env.PJ_NAME }}-${{ matrix.target }}.zip ${{ env.PJ_NAME }}.exe
cd -
- name: Post Build | Upload artifacts [-nix]
uses: actions/upload-artifact@v3
if: matrix.os != 'windows-latest'
with:
name: ${{ env.PJ_NAME }}-${{ matrix.target }}.tar.gz
path: ${{ env.PJ_NAME }}-${{ matrix.target }}.tar.gz
- name: Post Build | Upload artifacts [Windows]
uses: actions/upload-artifact@v3
if: matrix.os == 'windows-latest'
with:
name: ${{ env.PJ_NAME }}-${{ matrix.target }}.zip
path: ${{ env.PJ_NAME }}-${{ matrix.target }}.zip
github_release:
name: Make a new GitHub release for ${{ github.ref_name }}
needs: [build, changelog]

Check failure on line 94 in .github/workflows/release.yml

View workflow run for this annotation

GitHub Actions / Release to GitHub and Crates.io

Invalid workflow file

The workflow is not valid. .github/workflows/release.yml (Line: 94, Col: 20): Job 'github_release' depends on unknown job 'changelog'. .github/workflows/release.yml (Line: 112, Col: 20): Job 'crates_io_publish' depends on unknown job 'changelog'.
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: dawidd6/action-download-artifact@v2
with:
workflow: pre-release.yml
workflow_conclusion: success
- name: Add Artifacts to Release
uses: softprops/action-gh-release@v1
with:
files: ${{ env.PJ_NAME }}-*/${{ env.PJ_NAME }}-*
body_path: release-note/RELEASE_NOTE.md
tag_name: ${{ github.ref_name }}
crates_io_publish:
name: Publish ${{ github.ref_name }} to Crates.io
needs: [build, changelog]
runs-on: ubuntu-latest
steps:
- name: Setup | Checkout
uses: actions/checkout@v3
- name: Publish
run: cargo publish --token ${{ secrets.CARGO_REGISTRY_TOKEN }}