Skip to content

Commit 35bb904

Browse files
committed
bump Go to 1.21, compress, push tag attachments
This only builds for PRs and drops the artifact upload, and publishes attachements for tags instead, so that each individual file can be downloaded from a release page on GitHub. We should figure out if we can share the u-root commit to use between the two actions, or find some other solution. Signed-off-by: Daniel Maslowski <[email protected]>
1 parent c287f3d commit 35bb904

File tree

2 files changed

+49
-9
lines changed

2 files changed

+49
-9
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: u-root-builder
1+
name: u-root-buildcheck
22

33
on:
44
push:
@@ -7,7 +7,6 @@ on:
77
branches: [ "main" ]
88

99
jobs:
10-
1110
build:
1211
strategy:
1312
matrix:
@@ -23,14 +22,11 @@ jobs:
2322
- name: Set up Go
2423
uses: actions/setup-go@v4
2524
with:
26-
go-version: '1.20'
25+
go-version: '1.21'
2726

2827
- name: Build
2928
run: |
3029
go build .
31-
GOARCH=${{ matrix.arch }} ./u-root -uroot-source . -o u-root-${{ matrix.arch }}-${{ matrix.template }}.cpio ${{ matrix.template }}
32-
33-
- name: Upload
34-
uses: actions/[email protected]
35-
with:
36-
path: u-root-${{ matrix.arch }}-${{ matrix.template }}.cpio
30+
GOARCH=${{ matrix.arch }} ./u-root -uroot-source . \
31+
-o u-root-${{ matrix.arch }}-${{ matrix.template }}.cpio \
32+
${{ matrix.template }}

.github/workflows/publish.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: u-root-publish
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
publish:
10+
strategy:
11+
matrix:
12+
template: [core, all, embedded, minimal]
13+
arch: [amd64, arm, arm64, riscv64]
14+
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v3
19+
with:
20+
repository: u-root/u-root
21+
22+
- name: Set up Go
23+
uses: actions/setup-go@v4
24+
with:
25+
go-version: '1.21'
26+
27+
- name: Build
28+
run: |
29+
go build .
30+
GOARCH=${{ matrix.arch }} ./u-root -uroot-source . \
31+
-o ${{ matrix.arch }}-${{ matrix.template }}.cpio \
32+
${{ matrix.template }}
33+
xz --check=crc32 -9 --lzma2=dict=1MiB \
34+
--stdout ${{ matrix.arch }}-${{ matrix.template }}.cpio | \
35+
dd conv=sync bs=512 \
36+
of=${{ matrix.arch }}-${{ matrix.template }}.cpio.xz
37+
38+
- name: Upload
39+
uses: svenstaro/upload-release-action@v2
40+
with:
41+
repo_token: ${{ secrets.GITHUB_TOKEN }}
42+
tag: ${{ github.ref }}
43+
file: ${{ matrix.arch }}-${{ matrix.template }}.cpio.xz
44+
asset_name: u-root_${{ matrix.arch }}_${{ matrix.template }}.cpio.xz

0 commit comments

Comments
 (0)