update build tools #1764
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: update build tools | |
on: | |
push: | |
paths: | |
- "scripts/*/cpanfile" | |
- ".github/workflows/update-build-tools.yml" | |
branches-ignore: | |
# to avoid recursion | |
- "auto-update/**" | |
schedule: | |
- cron: "27 23 * * *" | |
workflow_dispatch: | |
jobs: | |
linux: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: carton install | |
shell: bash | |
run: | | |
rm -f cpanfile.snapshot | |
../../bin/carton install | |
working-directory: ./scripts/linux | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: cpanfile.snapshot-linux | |
path: scripts/linux/cpanfile.snapshot | |
darwin: | |
runs-on: macos-13 | |
steps: | |
- name: setup host perl | |
run: perl -MConfig -E 'say "$Config{bin}"' >> "$GITHUB_PATH" | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: carton install | |
shell: bash | |
run: | | |
rm -f cpanfile.snapshot | |
../../bin/carton install | |
working-directory: ./scripts/darwin | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: cpanfile.snapshot-darwin | |
path: scripts/darwin/cpanfile.snapshot | |
windows: | |
runs-on: windows-2019 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: setup host perl | |
shell: bash | |
run: | | |
cat << 'END_OF_PATH' >> "$GITHUB_PATH" | |
C:\MinGW\bin | |
C:\strawberry\perl\site\bin | |
C:\strawberry\perl\bin | |
END_OF_PATH | |
- run: "rm -f scripts/windows/cpanfile.snapshot" | |
shell: bash | |
- name: carton install | |
shell: cmd | |
run: ..\..\bin\carton install | |
working-directory: ./scripts/windows | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: cpanfile.snapshot-windows | |
path: scripts/windows/cpanfile.snapshot | |
common: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: carton install | |
shell: bash | |
run: | | |
rm -f cpanfile.snapshot | |
../../bin/carton install | |
working-directory: ./scripts/common | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: cpanfile.snapshot-common | |
path: scripts/common/cpanfile.snapshot | |
commit: | |
runs-on: ubuntu-latest | |
needs: | |
- linux | |
- darwin | |
- windows | |
- common | |
permissions: | |
id-token: write | |
contents: write | |
pull-requests: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: cleanup | |
run: | | |
rm -f scripts/linux/cpanfile.snapshot | |
rm -f scripts/darwin/cpanfile.snapshot | |
rm -f scripts/windows/cpanfile.snapshot | |
rm -f scripts/common/cpanfile.snapshot | |
- name: download cpanfile.snapshot for linux | |
uses: actions/download-artifact@v4 | |
with: | |
name: cpanfile.snapshot-linux | |
path: scripts/linux | |
- name: download cpanfile.snapshot for darwin | |
uses: actions/download-artifact@v4 | |
with: | |
name: cpanfile.snapshot-darwin | |
path: scripts/darwin | |
- name: download cpanfile.snapshot for windows | |
uses: actions/download-artifact@v4 | |
with: | |
name: cpanfile.snapshot-windows | |
path: scripts/windows | |
- name: download cpanfile.snapshot for any-platform | |
uses: actions/download-artifact@v4 | |
with: | |
name: cpanfile.snapshot-common | |
path: scripts/common | |
- name: update other dependencies | |
run: | | |
./.github/update-dependencies.sh | |
env: | |
GH_TOKEN: ${{ github.token }} | |
- name: Generate token | |
id: generate_token | |
uses: shogo82148/actions-github-app-token@v1 | |
- name: commit | |
uses: shogo82148/actions-commit-and-create-pr@v1 | |
with: | |
github-token: ${{ steps.generate_token.outputs.token }} | |
head-branch-prefix: "auto-update/build-tools-" | |
commit-message: "update build tools" |