Skip to content

Commit db08ea4

Browse files
committed
github ci
1 parent b1df48c commit db08ea4

File tree

4 files changed

+50
-50
lines changed

4 files changed

+50
-50
lines changed

.github/workflows/ci.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: ci
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
name: build tgz
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
12+
13+
- uses: cachix/install-nix-action@v6
14+
- uses: cachix/cachix-action@v3
15+
with:
16+
name: zfs-snap-diff
17+
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
18+
19+
- name: build
20+
run: |
21+
set -x
22+
VERSION=$(git describe --always)
23+
for GOOS in linux freebsd darwin solaris; do
24+
echo "BUILD: $GOOS"
25+
BUILD=$(nix-build --no-out-link --no-build-output -A zfs-snap-diff --argstr goos $GOOS)
26+
cp -fv $BUILD/bin/zfs-snap-diff .
27+
cp -fv $BUILD/bin/zsd .
28+
cp -fv $BUILD/share/LICENSE .
29+
30+
ARCHIVE=zfs-snap-diff-$GOOS-$VERSION.tgz
31+
tar cvfz $ARCHIVE zfs-snap-diff zsd LICENSE
32+
done
33+
34+
- name: upload assets
35+
uses: softprops/action-gh-release@v1
36+
if: startsWith(github.ref, 'refs/tags/v')
37+
with:
38+
files: zfs-snap-diff*.tgz
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflow/gh-pages.yml renamed to .github/workflows/gh-pages.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
name: GitHub Pages
22
on:
33
push:
4-
branches: [master]
4+
branches: [dev]
55

66
jobs:
77
gh-pages:
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/checkout@v1
11-
- uses: cachix/install-nix-action@6
10+
- uses: actions/checkout@v2
11+
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
12+
- uses: cachix/install-nix-action@v6
1213

1314
- name: build
1415
run: nix-build -A site

default.nix

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,18 @@ let
108108
'';
109109

110110
installPhase = ''
111-
mkdir -p $out/bin
111+
mkdir -p $out
112112
113113
BIN_PATH=${if goos == pkgs.stdenv.buildPlatform.parsed.kernel.name
114114
then "$GOPATH/bin"
115115
else "$GOPATH/bin/${goos}_$GOARCH"}
116+
117+
mkdir -p $out/bin
116118
cp $BIN_PATH/zfs-snap-diff $out/bin
117119
cp $BIN_PATH/zsd $out/bin
120+
121+
mkdir -p $out/share
122+
cp LICENSE $out/share
118123
'';
119124
};
120125

publish-site.sh

Lines changed: 0 additions & 46 deletions
This file was deleted.

0 commit comments

Comments
 (0)