Use nix flakes instead of niv #10
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
name: CI | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
permissions: | |
contents: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Install nix | |
uses: cachix/install-nix-action@v20 | |
with: | |
nix_path: nixpkgs=channel:nixos-unstable | |
- name: Use cachix | |
uses: cachix/cachix-action@v12 | |
with: | |
name: gg | |
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}' | |
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' | |
extraPullNames: nix-community | |
- name: Build binary | |
run: NIX_PATH='' nix-build --show-trace | |
- name: Upload binary as artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: gg | |
path: result/bin/gg | |
- name: Delete existing release | |
uses: dev-drprasad/delete-tag-and-release@v1.0.1 | |
with: | |
tag_name: nightly | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create Release | |
uses: ncipollo/release-action@v1.12.0 | |
if: github.ref == 'refs/heads/master' | |
with: | |
tag: nightly | |
commit: ${{ github.sha }} | |
name: Latest binary build | |
body: "Nightly build of the latest code in master. Download the static binary [gg](https://github.com/u-quark/gg/releases/download/nightly/gg) and `chmod +x` it." | |
prerelease: true | |
artifacts: result/bin/gg | |
allowUpdates: true | |
artifactErrorsFailBuild: true | |
removeArtifacts: true |