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)
|
|
|
|
|
2024-02-29 05:36:56 +00:00
|
|
|
permissions: {}
|
2022-11-21 15:24:26 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
bake-appveyor-image:
|
|
|
|
name: Bake AppVeyor Image
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2024-02-29 05:36:56 +00:00
|
|
|
- name: Generate GitHub App token
|
|
|
|
uses: electron/github-app-auth-action@384fd19694fe7b6dcc9a684746c6976ad78228ae # v1.1.1
|
|
|
|
id: generate-token
|
|
|
|
with:
|
|
|
|
creds: ${{ secrets.APPVEYOR_UPDATER_GH_APP_CREDS }}
|
2022-11-21 15:24:26 +00:00
|
|
|
- name: Checkout
|
2024-10-01 16:16:20 +00:00
|
|
|
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
|
2022-11-21 15:24:26 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2024-02-29 05:36:56 +00:00
|
|
|
token: ${{ steps.generate-token.outputs.token }}
|
2022-11-21 15:24:26 +00:00
|
|
|
- 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 }}
|
2024-08-07 08:02:31 +00:00
|
|
|
uses: mikefarah/yq@bbdd97482f2d439126582a59689eb1c855944955 # v4.44.3
|
2022-11-21 15:24:26 +00:00
|
|
|
with:
|
2023-03-28 00:57:27 +00:00
|
|
|
cmd: |
|
|
|
|
yq '.image = "${{ env.APPVEYOR_IMAGE_VERSION }}"' "appveyor.yml" > "appveyor2.yml"
|
|
|
|
yq '.image = "${{ env.APPVEYOR_IMAGE_VERSION }}"' "appveyor-woa.yml" > "appveyor-woa2.yml"
|
2022-11-21 15:24:26 +00:00
|
|
|
- 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
|
2024-02-29 05:36:56 +00:00
|
|
|
git add appveyor.yml
|
2023-03-13 23:44:27 +00:00
|
|
|
- name: (Optionally) Generate Commit Diff for WOA
|
|
|
|
if: ${{ env.APPVEYOR_IMAGE_VERSION }}
|
|
|
|
run: |
|
|
|
|
diff -w -B appveyor-woa.yml appveyor-woa2.yml > appveyor-woa.diff || true
|
|
|
|
patch -f appveyor-woa.yml < appveyor-woa.diff
|
|
|
|
rm appveyor-woa2.yml appveyor-woa.diff
|
2024-02-29 05:36:56 +00:00
|
|
|
git add appveyor-woa.yml
|
|
|
|
- name: (Optionally) Commit to Branch
|
2022-11-21 15:24:26 +00:00
|
|
|
if: ${{ env.APPVEYOR_IMAGE_VERSION }}
|
2024-08-13 13:13:55 +00:00
|
|
|
uses: dsanders11/github-app-commit-action@43de6da2f4d927e997c0784c7a0b61bd19ad6aac # v1.5.0
|
2022-11-21 15:24:26 +00:00
|
|
|
with:
|
2024-02-29 05:36:56 +00:00
|
|
|
message: 'build: update appveyor image to latest version'
|
|
|
|
ref: bump-appveyor-image
|
|
|
|
token: ${{ steps.generate-token.outputs.token }}
|
|
|
|
- name: (Optionally) Create Pull Request
|
|
|
|
if: ${{ env.APPVEYOR_IMAGE_VERSION }}
|
|
|
|
run: |
|
2024-03-01 20:53:30 +00:00
|
|
|
printf "This PR updates appveyor.yml to the latest baked image, ${{ env.APPVEYOR_IMAGE_VERSION }}.\n\nNotes: none" | gh pr create --head bump-appveyor-image --label no-backport --label semver/none --title 'build: update appveyor image to latest version' --body-file=-
|
2024-02-29 05:36:56 +00:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
|