@@ -10,51 +10,52 @@ jobs:
10
10
secrets :
11
11
nixbuild_token : ${{ secrets.nixbuild_token }}
12
12
with :
13
- filter_builds : ' (.top_attr == "packages") and (.system == "x86_64-linux" or .system == "aarch64-linux") and (.attr == "uniond" or .attr == "uniond-image")' # ensure to append this list if you want to release more artifacts
13
+ filter_builds : ' (.top_attr == "packages") and (.system == "x86_64-linux" or .system == "aarch64-linux") and (.attr == "uniond" or .attr == "unionpd" or .attr == " uniond-image" or .attr == "unionpd -image")' # ensure to append this list if you want to release more artifacts
14
14
15
- download-docker -images :
15
+ dl -images :
16
16
runs-on : ubuntu-latest
17
17
needs : [build]
18
18
permissions : write-all
19
19
strategy :
20
20
matrix :
21
- package : [ uniond-image ]
21
+ package : [ uniond, unionpd ]
22
22
system : [ aarch64-linux, x86_64-linux ]
23
23
steps :
24
24
- uses : actions/download-artifact@v3
25
25
with :
26
- name : packages.${{ matrix.system }}.${{ matrix.package }}
26
+ name : packages.${{ matrix.system }}.${{ matrix.package }}-image
27
27
- uses : nixbuild/nix-quick-install-action@v22
28
28
- uses : nixbuild/nixbuild-action@v17
29
29
with :
30
30
nixbuild_token : ${{ secrets.nixbuild_token }}
31
31
- run : mkdir ${{ matrix.system }}
32
- - run : nix copy --to file://`pwd`/${{ matrix.system }} --from ssh-ng://eu.nixbuild.net `cat result.json | jq -r '.packages."${{ matrix.system }}"."${{ matrix.package }}".outputs.out'` --extra-experimental-features nix-command
33
- - run : cat ${{ matrix.system }}/nar/*.nar.xz | xz -dc | nix-store --restore ${{ matrix.system }}.${{ matrix.package }}
32
+ - run : nix copy --to file://`pwd`/${{ matrix.system }} --from ssh-ng://eu.nixbuild.net `cat result.json | jq -r '.packages."${{ matrix.system }}"."${{ matrix.package }}-image ".outputs.out'` --extra-experimental-features nix-command
33
+ - run : cat ${{ matrix.system }}/nar/*.nar.xz | xz -dc | nix-store --restore ${{ matrix.system }}.${{ matrix.package }}-image
34
34
- uses : actions/upload-artifact@v3
35
35
with :
36
- name : ${{ matrix.system }}.${{ matrix.package }}
37
- path : ${{ matrix.system }}.${{ matrix.package }}
36
+ name : ${{ matrix.system }}.${{ matrix.package }}-image
37
+ path : ${{ matrix.system }}.${{ matrix.package }}-image
38
38
- uses : docker/login-action@v2
39
39
with :
40
40
registry : ghcr.io
41
41
username : ${{ github.actor }}
42
42
password : ${{ secrets.GITHUB_TOKEN }}
43
- - run : docker load < ${{ matrix.system }}.uniond -image
44
- - run : docker tag `docker images -q uniond ` ghcr.io/unionfi/uniond :${{ github.ref_name }}-${{ matrix.system }}
45
- - run : docker push ghcr.io/unionfi/uniond :${{ github.ref_name }}-${{ matrix.system }}
43
+ - run : docker load < ${{ matrix.system }}.${{ matrix.package }} -image
44
+ - run : docker tag `docker images -q ${{ matrix.package }} ` ghcr.io/unionfi/${{ matrix.package }} :${{ github.ref_name }}-${{ matrix.system }}
45
+ - run : docker push ghcr.io/unionfi/${{ matrix.package }} :${{ github.ref_name }}-${{ matrix.system }}
46
46
47
- download-static-binaries :
47
+ dl-bins :
48
48
runs-on : ubuntu-latest
49
49
needs : [build]
50
50
permissions : write-all
51
51
strategy :
52
52
matrix :
53
53
system : [ aarch64-linux, x86_64-linux ]
54
+ package : [ uniond, unionpd ]
54
55
steps :
55
56
- uses : actions/download-artifact@v3
56
57
with :
57
- name : packages.${{ matrix.system }}.uniond
58
+ name : packages.${{ matrix.system }}.${{ matrix.package }}
58
59
- uses : nixbuild/nix-quick-install-action@v22
59
60
- uses : nixbuild/nixbuild-action@v17
60
61
with :
@@ -64,54 +65,61 @@ jobs:
64
65
- run : ls -la ${{ matrix.system }}
65
66
- run : |
66
67
echo "Getting OUTPUT and NARINFO_NAME"
67
- OUTPUT=`cat result.json | jq -r '.packages."${{ matrix.system }}".uniond.outputs.out'`
68
- prefix="/nix/store/"
69
- suffix="-uniond" # <- HACK: suffix is hardcoded, change when you want to build a different package
70
- trimmed=${OUTPUT#$prefix}
71
- trimmed=${trimmed%$suffix}
72
- NARINFO_NAME=$trimmed
68
+ pwd
69
+ cat result.json
70
+ OUTPUT=`cat result.json | jq -r '.packages."${{ matrix.system }}"."${{ matrix.package }}".outputs.out'`
71
+ NARINFO_NAME=$(basename "$OUTPUT" | cut -d'-' -f1)
72
+ echo "OUTPUT = $OUTPUT"
73
+ echo "NARINFO_NAME = $NARINFO_NAME"
74
+
73
75
74
76
echo "Copying artifacts from nixbuild.net"
75
77
nix copy --to file://`pwd`/${{ matrix.system }} --from ssh-ng://eu.nixbuild.net $OUTPUT --extra-experimental-features nix-command
78
+
79
+ echo "TREE v"
80
+ tree
76
81
77
82
echo "Get the NAR_URL"
78
83
nar_url_line=$(cat ./${{ matrix.system }}/${NARINFO_NAME}.narinfo | grep "URL:")
79
84
NAR_URL=$(echo "$nar_url_line" | cut -d " " -f 2-)
80
85
81
86
echo "Restore the package from the NAR_URL archive"
82
- cat ${{ matrix.system }}/${NAR_URL} | xz -dc | nix-store --restore ${{ matrix.system }}.uniond
83
- mv ${{ matrix.system }}.uniond /bin/uniond uniond -${{ matrix.system }}
87
+ cat ${{ matrix.system }}/${NAR_URL} | xz -dc | nix-store --restore ${{ matrix.system }}.${{ matrix.package }}
88
+ mv ${{ matrix.system }}.${{ matrix.package }} /bin/${{ matrix.package }} ${{ matrix.package }} -${{ matrix.system }}
84
89
85
90
echo "DEBUG"
86
91
ls -la
87
92
tree
88
93
- uses : actions/upload-artifact@v3
89
94
with :
90
- name : uniond -${{ matrix.system }}
91
- path : uniond -${{ matrix.system }}
95
+ name : ${{ matrix.package }} -${{ matrix.system }}
96
+ path : ${{ matrix.package }} -${{ matrix.system }}
92
97
93
- create- docker-manifest :
98
+ docker-manifest :
94
99
runs-on : ubuntu-latest
95
- needs : [download-docker- images]
100
+ needs : [ dl- images ]
96
101
permissions : write-all
102
+ strategy :
103
+ matrix :
104
+ package : [ uniond, unionpd ]
97
105
steps :
98
106
- uses : docker/login-action@v2
99
107
with :
100
108
registry : ghcr.io
101
109
username : ${{ github.actor }}
102
110
password : ${{ secrets.GITHUB_TOKEN }}
103
- - run : docker pull ghcr.io/unionfi/uniond :${{ github.ref_name }}-aarch64-linux
104
- - run : docker pull ghcr.io/unionfi/uniond :${{ github.ref_name }}-x86_64-linux
111
+ - run : docker pull ghcr.io/unionfi/${{ matrix.package }} :${{ github.ref_name }}-aarch64-linux
112
+ - run : docker pull ghcr.io/unionfi/${{ matrix.package }} :${{ github.ref_name }}-x86_64-linux
105
113
- run : |
106
114
docker manifest create \
107
- ghcr.io/unionfi/uniond :${{ github.ref_name }} \
108
- --amend ghcr.io/unionfi/uniond :${{ github.ref_name }}-aarch64-linux \
109
- --amend ghcr.io/unionfi/uniond :${{ github.ref_name }}-x86_64-linux \
110
- - run : docker manifest push ghcr.io/unionfi/uniond :${{ github.ref_name }}
115
+ ghcr.io/unionfi/${{ matrix.package }} :${{ github.ref_name }} \
116
+ --amend ghcr.io/unionfi/${{ matrix.package }} :${{ github.ref_name }}-aarch64-linux \
117
+ --amend ghcr.io/unionfi/${{ matrix.package }} :${{ github.ref_name }}-x86_64-linux \
118
+ - run : docker manifest push ghcr.io/unionfi/${{ matrix.package }} :${{ github.ref_name }}
111
119
112
120
release :
113
121
runs-on : ubuntu-latest
114
- needs : [create- docker-manifest, download-static-binaries ]
122
+ needs : [ docker-manifest, dl-bins ]
115
123
permissions : write-all
116
124
steps :
117
125
- uses : actions/download-artifact@v3
@@ -129,6 +137,8 @@ jobs:
129
137
files : |
130
138
uniond-aarch64-linux
131
139
uniond-x86_64-linux
140
+ unionpd-aarch64-linux
141
+ unionpd-x86_64-linux
132
142
- if : " !contains(github.ref_name, 'rc')"
133
143
name : ' Create Release'
134
144
uses :
marvinpinto/[email protected]
@@ -140,3 +150,5 @@ jobs:
140
150
files : |
141
151
uniond-aarch64-linux
142
152
uniond-x86_64-linux
153
+ unionpd-aarch64-linux
154
+ unionpd-x86_64-linux
0 commit comments