1+ name : ci
2+
3+ on :
4+ push :
5+ branches :
6+ - " *"
7+ pull_request :
8+ branches :
9+ - beta
10+ - next
11+
12+ permissions :
13+ contents : write
14+
15+ jobs :
16+ lint :
17+ runs-on : ubuntu-latest
18+ steps :
19+ - uses : actions/checkout@v4
20+ with :
21+ fetch-depth : 0
22+ - uses : asdf-vm/actions/install@v3
23+ - uses : actions/setup-go@v5
24+ with :
25+ go-version : ' >=1.22.6'
26+ - uses : golangci/golangci-lint-action@v6
27+ with :
28+ version : latest
29+ skip-cache : false
30+ test :
31+ runs-on : ubuntu-latest
32+ steps :
33+ - uses : actions/checkout@v4
34+ with :
35+ fetch-depth : 0
36+ - uses : asdf-vm/actions/install@v3
37+ - uses : actions/setup-go@v5
38+ with :
39+ go-version : ' >=1.22.6'
40+ - run : make test
41+ test-acceptance :
42+ runs-on : ubuntu-latest
43+ steps :
44+ - run : dd if=/dev/zero of=/tmp/zfsstorage bs=524288000 count=1 # 500mb storage
45+ - run : sudo apt-get update
46+ - run : sudo apt install zfsutils-linux
47+ - run : sudo zpool create zfs-pool2 /tmp/zfsstorage
48+ - run : sudo zfs create zfs-pool2/unencrypted
49+ - run : echo "ddddddddddddddddddddddddddddddd" > /tmp/zfs-key
50+ - run : sudo zfs create -o encryption=on -o keylocation=file:///tmp/zfs-key -o keyformat=raw -u -v zfs-pool2/encrypted
51+ - uses : actions/checkout@v4
52+ with :
53+ fetch-depth : 0
54+ - uses : asdf-vm/actions/install@v3
55+ - uses : actions/setup-go@v5
56+ with :
57+ go-version : ' >=1.22.6'
58+ - run : sudo make test-acceptance
59+ release :
60+ runs-on : ubuntu-latest
61+ needs : [ lint, test, test-acceptance ]
62+ if : github.ref == 'refs/heads/beta' || github.ref == 'refs/heads/next'
63+ permissions :
64+ contents : write # to be able to publish a GitHub release
65+ issues : write # to be able to comment on released issues
66+ pull-requests : write # to be able to comment on released pull requests
67+ steps :
68+ - uses : actions/checkout@v4
69+ with :
70+ fetch-depth : 0
71+ - uses : asdf-vm/actions/install@v3
72+ - uses : actions/setup-go@v5
73+ with :
74+ go-version : ' >=1.22.6'
75+ - uses : cycjimmy/semantic-release-action@v4
76+ id : semantic
77+ with :
78+ extra_plugins : |
79+ @semantic-release/changelog
80+ @semantic-release/git
81+ env :
82+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
83+ - run : git reset --hard && git clean -fdx
84+ - uses : goreleaser/goreleaser-action@v6
85+ if : steps.semantic.outputs.new_release_published == 'true'
86+ with :
87+ distribution : goreleaser
88+ version : latest
89+ args : release
90+ env :
91+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
92+ docs :
93+ runs-on : ubuntu-latest
94+ if : github.ref == 'refs/heads/next'
95+ needs : [ release ]
96+ env :
97+ VERCEL_ORG_ID : ${{ secrets.VERCEL_ORG_ID }}
98+ VERCEL_PROJECT_ID : ${{ secrets.VERCEL_PROJECT_ID }}
99+ steps :
100+ - uses : actions/checkout@v4
101+ - name : Install Vercel CLI
102+ run : npm install --global vercel@latest
103+ - name : Pull Vercel Environment Information
104+ run : vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
105+ - name : Build Project Artifacts
106+ run : vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
107+ - name : Deploy Project Artifacts to Vercel
108+ run : vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}
0 commit comments