Skip to content

Commit

Permalink
chore(ci): Further harden workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
VorpalBlade committed Nov 3, 2024
1 parent 9534d99 commit ca5fcc9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
18 changes: 11 additions & 7 deletions .github/workflows/act_build_release.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
name: Release (helper)

permissions:
attestations: write
contents: write
id-token: write

on:
workflow_call:
inputs:
Expand Down Expand Up @@ -48,6 +43,8 @@ defaults:
jobs:
cargo-about:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -69,6 +66,10 @@ jobs:
upload:
name: "Upload ${{ inputs.project }}: ${{ matrix.target }}"
runs-on: ubuntu-latest
permissions:
attestations: write
contents: write
id-token: write
strategy:
matrix:
include:
Expand Down Expand Up @@ -122,12 +123,15 @@ jobs:
with:
persist-credentials: false
- name: Get AUR repo
run: git clone https://aur.archlinux.org/${{ inputs.project }}.git aur
run: git clone "https://aur.archlinux.org/${PROJECT}.git" aur
env:
PROJECT: ${{ inputs.project }}
- name: Update PKGBUILD
run: |
sed -i '/^_pkgver/s/=.*$/='${RELEASE_TAG#refs/tags/${{ inputs.project }}-v}'/' "aur/PKGBUILD"
sed -i '/^_pkgver/s/=.*$/='${RELEASE_TAG#refs/tags/${PROJECT}-v}'/' "aur/PKGBUILD"
sed -i '/^pkgrel/s/=.*$/=1/' "aur/PKGBUILD"
env:
PROJECT: ${{ inputs.project }}
RELEASE_TAG: ${{ github.ref }}
- name: Publish AUR package
uses: KSXGitHub/github-actions-deploy-aur@v3.0.1
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
name: Release

permissions:
attestations: write
contents: write
id-token: write

on:
release:
types: [published]
Expand All @@ -21,6 +16,10 @@ jobs:

paketkoll:
name: "Release paketkoll"
permissions:
attestations: write
contents: write
id-token: write
if: github.repository_owner == 'VorpalBlade' && startsWith(github.event.release.name, 'paketkoll-v')
uses: ./.github/workflows/act_build_release.yml
with:
Expand All @@ -35,6 +34,10 @@ jobs:

konfigkoll:
name: "Release konfigkoll"
permissions:
attestations: write
contents: write
id-token: write
if: github.repository_owner == 'VorpalBlade' && startsWith(github.event.release.name, 'konfigkoll-v')
uses: ./.github/workflows/act_build_release.yml
with:
Expand Down

0 comments on commit ca5fcc9

Please sign in to comment.