Skip to content

Commit

Permalink
Add build and release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
jardon committed Feb 6, 2025
1 parent 8e0cd6e commit ffaec55
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Build

on:
pull_request:
workflow_call:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
container:
image: ghcr.io/vanilla-os/pico:main
volumes:
- /proc:/proc
- /:/run/host
options: --privileged -it

steps:
- uses: actions/checkout@v4

- name: Install needed packages
run: |
DEBIAN_FRONTEND=noninteractive apt update
DEBIAN_FRONTEND=noninteractive apt install -y \
dpkg-dev \
build-essential \
debhelper-compat \
devscripts \
wget \
git
apt-get build-dep -y .
- name: Build debian package
id: build-deb
run: |
dpkg-buildpackage -b -rfakeroot -us -uc
sha256sum /__w/${{ github.event.repository.name }}/hplip_$(dpkg-parsechangelog -S version)_$(dpkg-architecture -qDEB_BUILD_ARCH).deb >> checksums.txt
- uses: actions/upload-artifact@v4
with:
name: ${{ github.event.repository.name }}
path: |
"../*.deb"
41 changes: 41 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Release

on:
workflow_dispatch:
push:
tags:
- '*'

jobs:
build-deb:
uses: ./.github/workflows/build.yaml

release:
runs-on: ubuntu-latest
needs: build-deb
permissions:
contents: write # to create and upload assets to releases
attestations: write # to upload assets attestation for build provenance
id-token: write # grant additional permission to attestation action to mint the OIDC token permission

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: ${{ github.event.repository.name }}

# - name: Create Release
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: gh release create "${{ github.ref_name }}" --generate-notes *.deb

# - name: Attest Release Files
# id: attest
# uses: actions/attest-build-provenance@v1
# with:
# subject-path: '*.tar.xz, gnome-control-center/*.txt'

0 comments on commit ffaec55

Please sign in to comment.