-
Notifications
You must be signed in to change notification settings - Fork 0
106 lines (93 loc) · 3.37 KB
/
package.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: Package
on:
push:
branches:
- master
- dev-workflow
pull_request:
release:
types: [published]
permissions:
contents: write
packages: write
jobs:
metadata:
name: Get metadata
runs-on: ubuntu-22.04
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
- name: Version
id: version
run: |
if ${{ startsWith(github.ref, 'refs/tags/') }}; then
echo "version=$(cat VERSION)" >> "$GITHUB_OUTPUT"
else
echo "version=devel" >> "$GITHUB_OUTPUT"
fi
binary:
name: Build binary
runs-on: ubuntu-22.04
needs: metadata
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
- name: Install Nix
uses: cachix/install-nix-action@3715ab1a11cac9e991980d7b4a28d80c7ebdd8f9 # v28
- name: Build
run: nix-shell --run 'build_release'
- name: Archive binary
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
with:
name: filc-${{ needs.metadata.outputs.version }}
path: ${{ github.workspace }}/filc
debian:
name: Build debian package
runs-on: ubuntu-22.04
needs: metadata
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
- name: Install Nix
uses: cachix/install-nix-action@3715ab1a11cac9e991980d7b4a28d80c7ebdd8f9 # v28
- name: Build
run: nix-shell --run 'build_deb_package'
- name: Archive package
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
with:
name: filc-${{ needs.metadata.outputs.version }}_deb
path: |
${{ github.workspace }}/out/deb_package/*.deb
${{ github.workspace }}/out/deb_package/*.deb.sha512
- name: Upload to release
if: ${{ startsWith(github.ref, 'refs/tags/') }}
uses: xresloader/upload-to-github-release@26f7cc1d7d924dc9b6d5008808be8278b7177811 # v1.6.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: "${{ github.workspace }}/out/deb_package/*.deb;${{ github.workspace }}/out/deb_package/*.deb.sha512"
tags: true
rpm:
name: Build rpm package
runs-on: ubuntu-22.04
needs: metadata
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
- name: Install Nix
uses: cachix/install-nix-action@3715ab1a11cac9e991980d7b4a28d80c7ebdd8f9 # v28
- name: Build
run: nix-shell --run 'build_rpm_package'
- name: Archive package
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
with:
name: filc-${{ needs.metadata.outputs.version }}_rpm
path: |
${{ github.workspace }}/out/rpm_package/*.rpm
${{ github.workspace }}/out/rpm_package/*.rpm.sha512
- name: Upload to release
if: ${{ startsWith(github.ref, 'refs/tags/') }}
uses: xresloader/upload-to-github-release@26f7cc1d7d924dc9b6d5008808be8278b7177811 # v1.6.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: "${{ github.workspace }}/out/rpm_package/*.rpm;${{ github.workspace }}/out/rpm_package/*.rpm.sha512"
tags: true