From 574178e1c7bd118c7b03f58bf9349fd8e05d2779 Mon Sep 17 00:00:00 2001 From: "K.B.Dharun Krishna" Date: Wed, 24 Jul 2024 23:57:22 +0530 Subject: [PATCH] cleanup: update files, add workflows Signed-off-by: K.B.Dharun Krishna --- .github/FUNDING.yml | 4 -- .github/workflows/build.yml | 66 +++++++++++++++++++------------ .github/workflows/release.yml | 73 +++++++++++++++++++++++++++++++++++ README.md | 1 - meson.build | 2 +- 5 files changed, 115 insertions(+), 31 deletions(-) delete mode 100644 .github/FUNDING.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index 25a690f3..00000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1,4 +0,0 @@ -# These are supported funding model platforms - -github: vanilla-os -liberapay: fabricators diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bc12b97a..edc4d1cf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,38 +1,54 @@ -name: Build release packages +name: Build + on: - release: - types: [published] - workflow_dispatch: + push: + branches: ["main"] + pull_request: + jobs: - build-packages: - runs-on: ubuntu-22.04 + 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@v2 + - uses: actions/checkout@v4 - # Misc - # -------------------------------------- - name: Get the version id: get_version - run: echo ::set-output name=VERSION::$(cat VERSION) + run: echo "{VERSION}={$(cat VERSION)}" >> $GITHUB_OUTPUT - # Dependencies - # -------------------------------------- - name: Install build dependencies run: | - sudo apt install -y debhelper python3 gettext build-essential desktop-file-utils ninja-build meson libadwaita-1-dev make + apt install -y debhelper python3 gettext build-essential desktop-file-utils ninja-build meson libadwaita-1-dev make libnm-dev libnma-dev libnma-gtk4-dev - # Deb Build - # -------------------------------------- - name: Build .deb package - run: dpkg-buildpackage + run: | + dpkg-buildpackage + mv ../vanilla-first-setup_*.deb . + + - name: Calculate and Save Checksums + run: | + sha256sum vanilla-first-setup_*.deb >> checksums.txt + + - uses: actions/upload-artifact@v4 + with: + name: first-setup + path: | + checksums.txt + vanilla-first-setup_*.deb - # Release packages - # -------------------------------------- - - uses: "marvinpinto/action-automatic-releases@latest" + - uses: softprops/action-gh-release@v2 + if: github.ref == 'refs/heads/main' with: - repo_token: "${{ secrets.GITHUB_TOKEN }}" - draft: false - prerelease: false - automatic_release_tag: ${{ steps.get_version.outputs.VERSION }} - title: ${{ steps.get_version.outputs.VERSION }} - files: ../vanilla-first-setup_*.deb \ No newline at end of file + token: "${{ secrets.GITHUB_TOKEN }}" + tag_name: "continuous" + prerelease: true + name: "Continuous Build" + files: | + checksums.txt + vanilla-first-setup_*.deb diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..eb85ad28 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,73 @@ +name: Release + +on: + push: + tags: + - '*' + +jobs: + build-artifacts: + runs-on: ubuntu-latest + container: + image: ghcr.io/vanilla-os/pico:main + volumes: + - /proc:/proc + - /:/run/host + options: --privileged -it + permissions: + contents: read + + steps: + - uses: actions/checkout@v4 + + - name: Get the version + id: get_version + run: echo ::set-output name=VERSION::$(cat VERSION) + + - name: Install build dependencies + run: | + apt install -y debhelper python3 gettext build-essential desktop-file-utils ninja-build meson libadwaita-1-dev make libnm-dev libnma-dev libnma-gtk4-dev + + - name: Build .deb package + run: dpkg-buildpackage + + - name: Calculate and Save Checksums + run: | + sha256sum vanilla-first-setup_2.2.0_amd64.deb >> checksums.txt + + - uses: actions/upload-artifact@v4 + with: + name: first-setup + path: | + checksums.txt + vanilla-first-setup_2.2.0_amd64.deb + + release: + runs-on: ubuntu-latest + needs: build-artifacts + 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: first-setup + + - name: Create Release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: gh release create "${{ github.ref_name }}" --generate-notes *.deb first-setup/checksums.txt + + - name: Attest Release Files + id: attest + uses: actions/attest-build-provenance@v1 + with: + subject-path: '*.deb, first-setup/*.txt' diff --git a/README.md b/README.md index 1c5064a3..376a25f4 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,6 @@ - ## Build ### Dependencies diff --git a/meson.build b/meson.build index c4620efb..0f8dc430 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('org.vanillaos.FirstSetup', - version: '2.0.1', + version: '2.2.0', meson_version: '>= 0.59.0', default_options: [ 'warning_level=2', 'werror=false',