From 16121b68a57de023eb4fb2df8ff356908a20c842 Mon Sep 17 00:00:00 2001 From: fwcd Date: Tue, 8 Aug 2023 16:19:40 +0200 Subject: [PATCH] Add CI workflow --- .github/workflows/release.yml | 41 +++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..ea4942b --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,41 @@ +name: Release + +on: + push: + schedule: + # Run every day at 5:20 + - cron: '20 5 * * *' + workflow_dispatch: + +permissions: + contents: write + +jobs: + release: + if: github.repository == 'fwcd/arch-repo' + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + submodules: true + - name: Set up Git user + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" + - name: Update packages + run: git submodule update --remote + - name: Commit updates + run: | + git add -A + git commit -m "Update packages ($(date -I))" || true + - name: Build packages + run: ./build-packages + - name: Publish release + if: github.ref == 'refs/heads/main' + run: | + tag="$(date -I)" + gh release create --title "$tag" "$tag" || true + gh release upload --clobber "$tag" build/* + - name: Push changes + run: git push