2022-11-21 15:24:26 +00:00
|
|
|
name: Update AppVeyor Image
|
|
|
|
|
|
|
|
# Run chron daily Mon-Fri
|
|
|
|
on:
|
2023-02-03 19:55:04 +00:00
|
|
|
workflow_dispatch:
|
2022-11-21 15:24:26 +00:00
|
|
|
schedule:
|
|
|
|
- cron: '0 8 * * 1-5' # runs 8:00 every business day (see https://crontab.guru)
|
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
pull-requests: write
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
bake-appveyor-image:
|
|
|
|
name: Bake AppVeyor Image
|
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
pull-requests: write # to create a new PR with updated Appveyor images
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2022-12-05 20:11:10 +00:00
|
|
|
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
|
2022-11-21 15:24:26 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
- name: Yarn install
|
|
|
|
run: |
|
|
|
|
node script/yarn.js install --frozen-lockfile
|
|
|
|
- name: Set Repo for Commit
|
|
|
|
run: git config --global --add safe.directory $GITHUB_WORKSPACE
|
|
|
|
- name: Check AppVeyor Image
|
|
|
|
env:
|
|
|
|
APPVEYOR_TOKEN: ${{ secrets.APPVEYOR_TOKEN }}
|
|
|
|
run: |
|
|
|
|
node ./script/prepare-appveyor
|
|
|
|
if [ -f ./image_version.txt ]; then
|
|
|
|
echo "APPVEYOR_IMAGE_VERSION="$(cat image_version.txt)"" >> $GITHUB_ENV
|
|
|
|
rm image_version.txt
|
|
|
|
fi
|
|
|
|
- name: (Optionally) Update Appveyor Image
|
|
|
|
if: ${{ env.APPVEYOR_IMAGE_VERSION }}
|
2022-12-05 20:11:10 +00:00
|
|
|
uses: mikefarah/yq@1c7dc0e88aad311c89889bc5ce5d8f96931a1bd0 # v4.27.2
|
2022-11-21 15:24:26 +00:00
|
|
|
with:
|
|
|
|
cmd: yq '.image = "${{ env.APPVEYOR_IMAGE_VERSION }}"' "appveyor.yml" > "appveyor2.yml"
|
|
|
|
- name: (Optionally) Generate Commit Diff
|
|
|
|
if: ${{ env.APPVEYOR_IMAGE_VERSION }}
|
|
|
|
run: |
|
|
|
|
diff -w -B appveyor.yml appveyor2.yml > appveyor.diff || true
|
|
|
|
patch -f appveyor.yml < appveyor.diff
|
|
|
|
rm appveyor2.yml appveyor.diff
|
|
|
|
- name: (Optionally) Commit and Pull Request
|
|
|
|
if: ${{ env.APPVEYOR_IMAGE_VERSION }}
|
2022-12-05 20:11:10 +00:00
|
|
|
uses: peter-evans/create-pull-request@2b011faafdcbc9ceb11414d64d0573f37c774b04 # v4.2.3
|
2022-11-21 15:24:26 +00:00
|
|
|
with:
|
2023-01-12 22:54:06 +00:00
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
2022-11-21 15:24:26 +00:00
|
|
|
commit-message: 'build: update appveyor image to latest version'
|
|
|
|
committer: GitHub <noreply@github.com>
|
|
|
|
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
|
|
|
|
signoff: false
|
|
|
|
branch: bump-appveyor-image
|
|
|
|
delete-branch: true
|
|
|
|
title: 'build: update appveyor image to latest version'
|
|
|
|
body: |
|
|
|
|
This PR updates appveyor.yml to the latest baked image, ${{ env.APPVEYOR_IMAGE_VERSION }}.
|