Skip to content

Commit

Permalink
[chore] github workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
floatshadow committed May 8, 2024
1 parent 4e70c10 commit 71f2b8c
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 2 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/accipit-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Accipit Build and Release

on:
workflow_dispatch:
release:
types: [ created ]

jobs:
build:
name: ${{ matrix.platform.os_name }} with rust ${{ matrix.toolchain }}
runs-on: ${{ matrix.platform.os }}
strategy:
fail-fast: false
matrix:
platform:
- os: linux-aarch64-musl
target: aarch64-unknown-linux-musl
asset: accipit-linux-aarch64-musl
- os: linux-x86_64-musl
target: x86_64-unknown-linux-musl
asset: accipit-linux-x86_64-musl
- os: linux-x86_64-gnu
target: x86_64-unknown-linux-gnu
asset: accipit-linux-x86_64-gnu
- os: windows-x86_64-msvc
target: x86_64-pc-windows-msvc
asset: accipit-windows-x86_64-msvc.exe
- os: windows-x86_64-gnu
target: x86_64-pc-windows-gnu
asset: accipit-windows-x86_64-gnu.exe
- os: darwin-x86_64
target: x86_64-apple-darwin
asset: accipit-darwin-x86_64
- os: darwin-aarch64
target: aarch64-apple-darwin
asset: accipit-darwin-aarch64
toolchain:
- stable
steps:
- uses: actions/checkout@v4
- name: Build binary
uses: houseabsolute/actions-rust-cross@v0
with:
command: "build"
target: ${{ matrix.platform.target }}
toolchain: ${{ matrix.toolchain }}
args: "--release"
strip: true
- name: Rename binary (linux and macos)
run: mv target/${{ matrix.platform.target }}/release/accipit target/${{ matrix.platform.target }}/release/${{ matrix.platform.asset }}
if: ${{ startWith(matrix.platform.os, 'linux') || startWith(matrix.platform.os, 'darwin') }}
- name: Rename binary (windows)
run: mv target/${{ matrix.platform.target }}/release/accipit.exe target/${{ matrix.platform.target }}/release/${{ matrix.platform.asset }}
if: ${{ startWith(matrix.platform.os, 'windows') }}
- name: Generate SHA-256
run: shasum -a 256 target/${{ matrix.platform.target }}/release/${{ matrix.platform.asset }} | cut -d ' ' -f 1 > target/${{ matrix.platform.target }}/release/${{ matrix.platform.asset }}.sha256
- name: Release binary and SHA-256 checksum to GitHub
uses: softprops/action-gh-release@v1
with:
files: |
target/${{ matrix.platform.target }}/release/${{ matrix.platform.asset }}
target/${{ matrix.platform.target }}/release/${{ matrix.platform.asset }}.sha256
8 changes: 6 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
name: Deploy on GitHub Pages

on:
workflow_dispatch:
push:
branches:
- main
paths:
- 'docs/**'
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.x
- run: pip install mkdocs-material mkdocs-heti-plugin
Expand Down

0 comments on commit 71f2b8c

Please sign in to comment.