Add building via gh workflows
This commit is contained in:
parent
8b1358c8d1
commit
5746a1a4fd
|
@ -0,0 +1,29 @@
|
||||||
|
name: main
|
||||||
|
|
||||||
|
on: push
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
name: Test
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: cachix/install-nix-action@v19
|
||||||
|
- run: nix develop -c go generate
|
||||||
|
- run: nix develop -c go test
|
||||||
|
|
||||||
|
release:
|
||||||
|
name: Build Release
|
||||||
|
if: startsWith(github.event.ref, 'refs/tags/v')
|
||||||
|
needs:
|
||||||
|
- test
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: cachix/install-nix-action@v19
|
||||||
|
- run: nix develop -c goreleaser release
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
- uses: softprops/action-gh-release@v1
|
||||||
|
with:
|
||||||
|
files: "*.deb"
|
|
@ -0,0 +1,28 @@
|
||||||
|
builds:
|
||||||
|
- id: debanator
|
||||||
|
main: ./cmd/main.go
|
||||||
|
ldflags:
|
||||||
|
- -s -w
|
||||||
|
- -X github.com/wlcx/debanator.Version={{.Version}}
|
||||||
|
- -X github.com/wlcx/debanator.Commit={{.ShortCommit}}
|
||||||
|
env:
|
||||||
|
- CGO_ENABLED=0
|
||||||
|
goos:
|
||||||
|
- linux
|
||||||
|
- darwin
|
||||||
|
goarch:
|
||||||
|
- arm
|
||||||
|
- arm64
|
||||||
|
- amd64
|
||||||
|
goarm:
|
||||||
|
- 7
|
||||||
|
|
||||||
|
nfpms:
|
||||||
|
- id: debanator
|
||||||
|
package_name: debanator
|
||||||
|
vendor: wlcx industries
|
||||||
|
builds:
|
||||||
|
- debanator
|
||||||
|
maintainer: Sam W <sam@wlcx.cc>
|
||||||
|
formats:
|
||||||
|
- deb
|
|
@ -30,7 +30,7 @@
|
||||||
apps.default = utils.lib.mkApp {drv = packages.default;};
|
apps.default = utils.lib.mkApp {drv = packages.default;};
|
||||||
|
|
||||||
devShells.default =
|
devShells.default =
|
||||||
pkgs.devshell.mkShell {packages = with pkgs; [go gopls];};
|
pkgs.devshell.mkShell {packages = with pkgs; [go gopls goreleaser];};
|
||||||
formatter = pkgs.alejandra;
|
formatter = pkgs.alejandra;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue