Skip to content

fix: comment some unused stuff and fix smth weird #50

fix: comment some unused stuff and fix smth weird

fix: comment some unused stuff and fix smth weird #50

Workflow file for this run

name: CI
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
tags:
- v*
jobs:
build-linux:
strategy:
matrix:
platform:
- name: x86_64
target: amd64
runs-on: ubuntu-latest
- name: aarch64
target: arm64
runs-on: [self-hosted, linux, ARM64]
runs-on: ${{ matrix.platform.runs-on }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: cachix/install-nix-action@v26
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- run: nix build
- name: Upload ${{ matrix.platform.name }}
uses: actions/upload-artifact@v4
with:
name: gfh-linux-${{ matrix.platform.name }}
path: |
./result/bin/gfh
./result/bin/gfh-keygen
build-macos:
runs-on: macos-11
strategy:
matrix:
target:
- x86_64
- aarch64
steps:
- uses: actions/checkout@v4
- name: Install target
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable-apple-darwin
target: ${{ matrix.target }}-apple-darwin
- name: Build
run: cargo build --release --target ${{ matrix.target }}-apple-darwin
- uses: actions/upload-artifact@v4
with:
name: gfh-macos-${{ matrix.target }}
path: |
target/${{ matrix.target }}-apple-darwin/release/gfh
target/${{ matrix.target }}-apple-darwin/release/gfh-keygen
build-windows:
runs-on: windows-2022
steps:
- uses: actions/checkout@v4
- name: Install target
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable-x86_64-pc-windows-msvc
target: x86_64-pc-windows-msvc
- name: Build
run: cargo build --release --target x86_64-pc-windows-msvc
- uses: actions/upload-artifact@v4
with:
name: "gfh-windows-x86_64"
path: |
target/x86_64-pc-windows-msvc/release/gfh.exe
target/x86_64-pc-windows-msvc/release/gfh-keygen.exe
# TODO: clippy lints & rustfmt
create-release:
runs-on: ubuntu-20.04
if: startsWith(github.ref, 'refs/tags/')
needs:
- build-linux
- build-macos
- build-windows
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
- name: Rename files
run: |
mkdir out && cd out
declare -a arr=(
"windows-x86_64"
"macos-x86_64"
"macos-aarch64"
"linux-x86_64"
"linux-aarch64"
)
for target in "${arr[@]}"
do
inputfiles="../gfh-$target/*"
if [[ "$target" == *windows* ]]; then
filename="gfh-$target.zip"
7z -y a $filename $inputfiles
else
filename="gfh-$target.tar.gz"
tar czf $filename $inputfiles
fi
sha256sum "$filename" >> "checksums.txt"
done
- name: Create draft release
uses: softprops/action-gh-release@v2
with:
body: Update the description for the release!
draft: true
files: ./out/*
# - name: Update Homebrew tap
# uses: mislav/bump-homebrew-formula-action@v2
# with:
# formula-name: gfh
# homebrew-tap: Ovyerus/homebrew-tap
# env:
# COMMITTER_TOKEN: ${{ secrets.TAP_COMMITTER_TOKEN }}