diff --git a/.github/workflows/container.yml b/.github/workflows/container.yml index 62e9083..5a75952 100644 --- a/.github/workflows/container.yml +++ b/.github/workflows/container.yml @@ -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 }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0d5be45..ebf169e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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: @@ -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 }}" diff --git a/scripts/test.sh b/scripts/test.sh index 53bb19a..5c2c49c 100644 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -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 diff --git a/scripts/update.sh b/scripts/update.sh index 2f89e7a..cd41170 100644 --- a/scripts/update.sh +++ b/scripts/update.sh @@ -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