Check for Affinity updates #184
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Check for Affinity updates | |
on: | |
schedule: | |
- cron: 0 0 * * * # daily | |
workflow_dispatch: | |
jobs: | |
get-current-version: | |
runs-on: ubuntu-latest | |
outputs: | |
current-version: ${{ steps.get-version.outputs.current-version }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: cachix/install-nix-action@v27 | |
with: | |
nix_path: nixpkgs=channel:nixos-unstable | |
- id: get-version | |
run: | | |
echo "current-version=$(nix eval --impure --json --expr 'let nixpkgs = import <nixpkgs> {}; source = nixpkgs.callPackage ./source.nix {}; in source._version' | tr -d '"')" >> $GITHUB_OUTPUT | |
get-live-version: | |
runs-on: ubuntu-latest | |
outputs: | |
live-version: ${{ steps.get-live-version.outputs.live-version }} | |
steps: | |
- uses: actions/checkout@v4 | |
- id: get-live-version | |
run: | | |
echo "live-version=$(curl https://store.serif.com/en-gb/update/windows/photo/2/ | grep "Download version" | awk '{print $NF}')" >> $GITHUB_OUTPUT | |
create-issue: | |
runs-on: ubuntu-latest | |
needs: | |
- get-live-version | |
- get-current-version | |
if: ${{ needs.get-live-version.outputs.live-version != needs.get-current-version.outputs.current-version }} | |
permissions: | |
issues: write | |
steps: | |
- name: Create Issue | |
run: | | |
new_issue_url=$(gh issue create \ | |
--title "bump suite version $CURRENT_VERSION > $LIVE_VERSION" \ | |
--assignee "mrshmllow" \ | |
--label "update" \ | |
--body "pls update the suite to $LIVE_VERSION") | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GH_REPO: ${{ github.repository }} | |
CURRENT_VERSION: ${{ needs.get-current-version.outputs.current-version }} | |
LIVE_VERSION: ${{ needs.get-live-version.outputs.live-version }} |