-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
125 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Setup nix | ||
description: Sets up nix and tools | ||
inputs: | ||
tools_package: | ||
description: Name of the package in the flake.nix file that provides all necessary tools | ||
required: false | ||
default: "tooling" | ||
token: | ||
description: GitHub PAT used for nix cache | ||
required: true | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
# https://github.com/actions/cache/issues/749 | ||
# there seems to be no way to cache nix stuff really | ||
# setting the store as suggested in the issue doesn't work | ||
- name: Install Nix | ||
uses: cachix/install-nix-action@v20 | ||
with: | ||
# token to avoid GitHub rate limiting | ||
extra_nix_config: | | ||
access-tokens = github.com=${{ inputs.token }} | ||
- name: Load environment | ||
# https://lobste.rs/s/qbsbcj/streamline_your_github_actions#c_1alxuy | ||
# NIX_STORE is required by cross to detect nix | ||
# This could break if env vars are set in shellHook etc. | ||
shell: bash | ||
run: | | ||
nix develop -c bash -c 'echo $PATH' >> "$GITHUB_PATH" | ||
echo "NIX_STORE=/nix/store" >> $GITHUB_ENV |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: release | ||
|
||
on: | ||
push: | ||
tags: | ||
- "*" | ||
jobs: | ||
build: | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
include: | ||
- { runner: macos-latest, filter: darwin } | ||
- { runner: ubuntu-latest, filter: linux } | ||
name: ${{ matrix.filter }} | ||
runs-on: ${{ matrix.runner }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ./.github/actions/nix-setup | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
# https://github.com/actions/cache/blob/main/examples.md#rust---cargo | ||
- uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cargo/bin/ | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
target/ | ||
out/ | ||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-cargo- | ||
- name: Build ${{ matrix.filter }} targets | ||
run: mask build --filter ${{ matrix.filter }} | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ matrix.filter }} | ||
path: out/bin/* | ||
release: | ||
permissions: | ||
contents: write | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
# required for goreleaser | ||
fetch-depth: 0 | ||
- uses: ./.github/actions/nix-setup | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
path: out/ | ||
- name: Move artifacts to /out/bin | ||
run: find out/ -type f -exec cp {} out/bin/ \; | ||
- name: Release | ||
run: goreleaser release --clean |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters