Skip to content

Commit affdf27

Browse files
committed
cleanup: update files, add release workflow
Signed-off-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>
1 parent eeeed41 commit affdf27

File tree

3 files changed

+95
-4
lines changed

3 files changed

+95
-4
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Ref: https://git-scm.com/docs/gitattributes
2+
* text=auto eol=lf
Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
name: build
1+
name: Build
22

33
on:
44
push:
55
branches: [ "main" ]
6+
pull_request:
67

78
jobs:
89
build:
9-
runs-on: ubuntu-22.04
10+
runs-on: ubuntu-latest
1011
container:
1112
image: ghcr.io/vanilla-os/pico:main
1213
volumes:
@@ -25,16 +26,29 @@ jobs:
2526
- name: Install needed packages
2627
run: apt update && apt install dpkg-dev build-essential debhelper librsvg2-bin optipng -y
2728

28-
- name: Build debian package
29+
- name: Build Debian package
2930
run: |
3031
dpkg-buildpackage --no-sign
3132
mv ../*.deb ../desktop-base.deb
3233
33-
- uses: softprops/action-gh-release@v1
34+
- name: Calculate and Save Checksums
35+
run: |
36+
sha256sum /__w/desktop-base/desktop-base.deb >> checksums.txt
37+
38+
- uses: actions/upload-artifact@v4
39+
with:
40+
name: desktop-base
41+
path: |
42+
/__w/desktop-base/desktop-base.deb
43+
checksums.txt
44+
45+
- uses: softprops/action-gh-release@v2
46+
if: github.ref == 'refs/heads/main'
3447
with:
3548
token: "${{ secrets.GITHUB_TOKEN }}"
3649
tag_name: "continuous"
3750
prerelease: true
3851
name: "Continuous Build"
3952
files: |
4053
/__w/desktop-base/desktop-base.deb
54+
checksums.txt

.github/workflows/release.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
build-artifacts:
10+
runs-on: ubuntu-latest
11+
container:
12+
image: ghcr.io/vanilla-os/pico:main
13+
volumes:
14+
- /proc:/proc
15+
- /:/run/host
16+
options: --privileged -it
17+
permissions:
18+
contents: read
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- name: De-bloat stock image
24+
run: |
25+
rm -r /run/host/usr/share/dotnet
26+
rm -r /run/host${{ runner.tool_cache }}
27+
28+
- name: Install needed packages
29+
run: apt update && apt install dpkg-dev build-essential debhelper librsvg2-bin optipng -y
30+
31+
- name: Build Debian package
32+
run: |
33+
dpkg-buildpackage --no-sign
34+
mv ../*.deb ../desktop-base.deb
35+
36+
- name: Calculate and Save Checksums
37+
run: |
38+
sha256sum /__w/desktop-base/desktop-base.deb >> checksums.txt
39+
40+
- uses: actions/upload-artifact@v4
41+
with:
42+
name: desktop-base
43+
path: |
44+
/__w/desktop-base/desktop-base.deb
45+
checksums.txt
46+
47+
release:
48+
runs-on: ubuntu-latest
49+
needs: build-artifacts
50+
permissions:
51+
contents: write # to create and upload assets to releases
52+
attestations: write # to upload assets attestation for build provenance
53+
id-token: write # grant additional permission to attestation action to mint the OIDC token permission
54+
55+
steps:
56+
- name: Checkout
57+
uses: actions/checkout@v4
58+
with:
59+
fetch-depth: 0
60+
61+
- name: Download Artifact
62+
uses: actions/download-artifact@v4
63+
with:
64+
name: desktop-base
65+
66+
- name: Create Release
67+
env:
68+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69+
run: gh release create "${{ github.ref_name }}" --generate-notes *.deb desktop-base/checksums.txt
70+
71+
- name: Attest Release Files
72+
id: attest
73+
uses: actions/attest-build-provenance@v1
74+
with:
75+
subject-path: '*.deb, desktop-base/*.txt'

0 commit comments

Comments
 (0)