Skip to content

Commit 26d4276

Browse files
authored
Merge pull request #28 from lima-vm/github-action
Create draft release via GitHub action
2 parents be7d593 + c7759ee commit 26d4276

File tree

3 files changed

+70
-6
lines changed

3 files changed

+70
-6
lines changed

.github/workflows/release.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
- 'test-v*'
8+
pull_request:
9+
10+
env:
11+
ALPINE_VERSION: 3.13.5
12+
DOCKER_BUILDKIT: 1
13+
14+
jobs:
15+
release:
16+
runs-on: ubuntu-latest
17+
timeout-minutes: 60
18+
19+
steps:
20+
- uses: actions/checkout@v2
21+
with:
22+
fetch-depth: 1
23+
submodules: recursive
24+
persist-credentials: false
25+
26+
- name: Install the arm64 emulator for binfmt_misc
27+
run: |
28+
docker run --privileged --rm tonistiigi/binfmt --install arm64
29+
30+
- name: Build the mkimage images
31+
run: |
32+
make mkimage ARCH=x86_64
33+
make mkimage ARCH=aarch64
34+
35+
- name: Build the std edition
36+
run: |
37+
make iso EDITION=std ARCH=x86_64
38+
make iso EDITION=std ARCH=aarch64
39+
40+
- name: Build the rd edition
41+
run: |
42+
make iso EDITION=rd ARCH=x86_64
43+
make iso EDITION=rd ARCH=aarch64
44+
45+
- name: Create release
46+
if: github.event_name != 'pull_request'
47+
env:
48+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49+
# Note "folded" style; requires a blank line to insert actual newline
50+
run: >
51+
tag="${GITHUB_REF##*/}"
52+
53+
hub release create
54+
-a iso/alpine-lima-std-${ALPINE_VERSION}-aarch64.iso
55+
-a iso/alpine-lima-std-${ALPINE_VERSION}-aarch64.iso.sha512sum
56+
-a iso/alpine-lima-std-${ALPINE_VERSION}-x86_64.iso
57+
-a iso/alpine-lima-std-${ALPINE_VERSION}-x86_64.iso.sha512sum
58+
-a iso/alpine-lima-rd-${ALPINE_VERSION}-aarch64.iso
59+
-a iso/alpine-lima-rd-${ALPINE_VERSION}-aarch64.iso.sha512sum
60+
-a iso/alpine-lima-rd-${ALPINE_VERSION}-x86_64.iso
61+
-a iso/alpine-lima-rd-${ALPINE_VERSION}-x86_64.iso.sha512sum
62+
-m "${tag}" --draft "${tag}"

Dockerfile

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@ RUN apk add alpine-sdk build-base apk-tools alpine-conf busybox \
88
ARG TARGETARCH
99
RUN if [ "${TARGETARCH}" = "amd64" ]; then apk add syslinux; fi
1010

11-
RUN adduser -h /home/build -D build -G abuild
12-
RUN echo "%abuild ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/abuild
11+
RUN addgroup root abuild
12+
RUN abuild-keygen -i -a -n
13+
RUN apk update
14+
1315
ADD src/aports /home/build/aports
1416
WORKDIR /home/build/aports/scripts
1517
ENTRYPOINT ["sh", "./mkimage.sh"]
16-
RUN apk update
17-
USER build
18-
RUN abuild-keygen -i -a -n

build.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ TAG="${EDITION}-${ALPINE_VERSION}"
77

88
source "edition/${EDITION}"
99

10-
docker run -it --rm \
10+
docker run --rm \
1111
--platform "linux/${ARCH_ALIAS}" \
1212
-v "${PWD}/iso:/iso" \
1313
-v "${PWD}/mkimg.lima.sh:/home/build/aports/scripts/mkimg.lima.sh:ro" \
@@ -29,3 +29,6 @@ docker run -it --rm \
2929
--repository "http://dl-cdn.alpinelinux.org/alpine/${REPO_VERSION}/main" \
3030
--repository "http://dl-cdn.alpinelinux.org/alpine/${REPO_VERSION}/community" \
3131
--profile lima
32+
33+
ISO="alpine-lima-${EDITION}-${ALPINE_VERSION}-${ARCH}.iso"
34+
cd iso && sha512sum "${ISO}" > "${ISO}.sha512sum"

0 commit comments

Comments
 (0)