From e4b19e9d2148223979d6228e963817fb3a245e54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Bj=C3=A4reholt?= Date: Wed, 31 Aug 2022 19:39:17 +0200 Subject: [PATCH] ci: more workflows to automate post-release tasks --- .github/workflows/aur.yml | 20 ++++++++++++++++++++ .github/workflows/tweet.yml | 31 +++++++++++++++++++++++++++++++ .github/workflows/winget.yml | 1 + 3 files changed, 52 insertions(+) create mode 100644 .github/workflows/aur.yml create mode 100644 .github/workflows/tweet.yml diff --git a/.github/workflows/aur.yml b/.github/workflows/aur.yml new file mode 100644 index 00000000..0469f10d --- /dev/null +++ b/.github/workflows/aur.yml @@ -0,0 +1,20 @@ +name: Update AUR package +on: + release: + types: [released] + +jobs: + update: + runs-on: ubuntu-latest + if: '!github.event.release.prerelease' + steps: + - run: | + git clone git@github.com:ActivityWatch/aur-activitywatch-bin.git + cd aur-activitywatch-bin + # set pkgver, reset pkgrel in PKGBUILD + sed -E -i 's/pkgver=.+$/pkgver=\'{{ github.event.release.tag_name }}\'/' PKGBUILD + sed -E -i 's/pkgrel=.+$/pkgrel=1/' PKGBUILD + make + git add PKGBUILD .SRCINFO + git commit -m "updated to {{ github.event.release.tag_name }}" + git push diff --git a/.github/workflows/tweet.yml b/.github/workflows/tweet.yml new file mode 100644 index 00000000..3f56069a --- /dev/null +++ b/.github/workflows/tweet.yml @@ -0,0 +1,31 @@ +name: Tweet +on: + release: + types: [published] + +jobs: + tweet-new-release: + name: New release + runs-on: ubuntu-latest + if: github.event.type == "ReleaseEvent" && !github.event.release.prerelease + steps: + - uses: ethomson/send-tweet-action@v1 + with: + status: "🚢 New version! ActivityWatch v{{ github.event.release.tag_name }} was just released! 🎉 +📦 Check out the release description for more info: {{ github.event.release.html_url }}" + consumer-key: ${{ secrets.TWITTER_CONSUMER_API_KEY }} + consumer-secret: ${{ secrets.TWITTER_CONSUMER_API_SECRET }} + access-token: ${{ secrets.TWITTER_ACCESS_TOKEN }} + access-token-secret: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }} + + # Would be cool to tweet at new contributors when they are detected (by the build_changelog.py script, probably) + #tweet-new-contributor: + # runs-on: ubuntu-latest + # steps: + # - uses: ethomson/send-tweet-action@v1 + # with: + # status: "Hi, this is a test!" + # consumer-key: ${{ secrets.TWITTER_CONSUMER_API_KEY }} + # consumer-secret: ${{ secrets.TWITTER_CONSUMER_API_SECRET }} + # access-token: ${{ secrets.TWITTER_ACCESS_TOKEN }} + # access-token-secret: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }} diff --git a/.github/workflows/winget.yml b/.github/workflows/winget.yml index c724a79e..5af9e3d2 100644 --- a/.github/workflows/winget.yml +++ b/.github/workflows/winget.yml @@ -2,6 +2,7 @@ name: Publish to WinGet on: release: types: [released] + jobs: publish: runs-on: windows-latest # action can only be run on windows