Skip to content

Commit

Permalink
Use setfacl and a scoped makepkg command
Browse files Browse the repository at this point in the history
Per actions/checkout#956 it seems GitHub
Actions straight up doesn't support running containers as non-root, so
maybe this will get things going.
  • Loading branch information
yorickpeterse committed Oct 30, 2023
1 parent 198a013 commit eb58220
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/container.yml
Expand Up @@ -5,6 +5,8 @@ on:
branches:
- main
workflow_dispatch:
schedule:
- cron: '15 1 * * 1'

concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/release.yml
Expand Up @@ -15,9 +15,10 @@ jobs:
runs-on: ubuntu-latest
container:
image: ghcr.io/inko-lang/aur:main
options: --user build
steps:
- uses: actions/checkout@v4
- name: Updating permissions
run: setfacl -R -m u:build:rwx .
- name: Running tests
run: bash scripts/test.sh "${{ github.event.inputs.name }}"
release:
Expand All @@ -26,11 +27,12 @@ jobs:
runs-on: ubuntu-latest
container:
image: ghcr.io/inko-lang/aur:main
options: --user build
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Updating permissions
run: setfacl -R -m u:build:rwx .
- name: Updating PKGBUILD
run: |
bash scripts/update.sh inko "${{ github.event.inputs.version }}"
Expand Down
9 changes: 8 additions & 1 deletion scripts/test.sh
Expand Up @@ -11,6 +11,13 @@ then
fi

cd "${name}"
makepkg --cleanbuild --force --noconfirm --clean

if [[ -v CI ]]
then
sudo -u build makepkg --cleanbuild --force --noconfirm --clean
else
makepkg --cleanbuild --force --noconfirm --clean
fi

rm *.tar.gz
rm *.zst
9 changes: 8 additions & 1 deletion scripts/update.sh
Expand Up @@ -23,7 +23,14 @@ sed --regexp-extended --in-place --expression \
"s/pkgver=(.+)/pkgver=${version}/g" PKGBUILD

updpkgsums PKGBUILD
makepkg --printsrcinfo > .SRCINFO

if [[ -v CI ]]
then
sudo -u build makepkg --printsrcinfo | tee .SRCINFO
else
makepkg --printsrcinfo > .SRCINFO
fi

rm *.tar.gz
git add PKGBUILD .SRCINFO

Expand Down

0 comments on commit eb58220

Please sign in to comment.