Update Dependencies #1748
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 Dependencies | |
on: | |
# Run every day on multiple occasions, with each job running at a different time to limit license-acquisition issues. | |
schedule: | |
- cron: '0 2 * * *' | |
- cron: '0 3 * * *' | |
# Allow a manual trigger to be able to run the update when there are new dependencies or after a PR merge to resolve CHANGELOG conflicts. | |
workflow_dispatch: | |
jobs: | |
deps: | |
name: ${{ matrix.name }} | |
if: github.event.schedule == '0 2 * * *' | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- name: Cocoa SDK | |
path: modules/sentry-cocoa.properties | |
- name: Java SDK | |
path: modules/sentry-java | |
- name: Native SDK | |
path: modules/sentry-native | |
- name: .NET SDK | |
path: src/sentry-dotnet | |
- name: CLI | |
path: modules/sentry-cli.properties | |
uses: getsentry/github-workflows/.github/workflows/updater.yml@v2 | |
with: | |
name: ${{ matrix.name }} | |
path: ${{ matrix.path }} | |
secrets: | |
api-token: ${{ secrets.CI_DEPLOY_KEY }} | |
unity: | |
name: Unity ${{ matrix.unity-prefix }} PR | |
if: github.event.schedule == '0 3 * * *' | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: pwsh | |
strategy: | |
fail-fast: false | |
matrix: | |
unity-prefix: ['2019.', '2020.', '2021.', '2022.'] | |
steps: | |
- name: Find the latest Unity version | |
id: version-select | |
run: | | |
$page = Invoke-WebRequest -UseBasicParsing -Uri 'https://unity.com/releases/editor/archive' | |
$latest = $page.RawContent | Select-String -Pattern '\"unityhub://(${{ matrix.unity-prefix }}[a-z0-9.-]+)/([a-z0-9]+)\\' | |
"version=$($latest.Matches.Groups[1].value)" >> $env:GITHUB_OUTPUT | |
"changeset=$($latest.Matches.Groups[2].value)" >> $env:GITHUB_OUTPUT | |
echo "Latest version: $version ($changeset)" | |
- uses: actions/checkout@v3 | |
with: | |
ssh-key: ${{ secrets.CI_DEPLOY_KEY }} | |
- name: Update sample ProjectVersion.txt | |
if: ${{ matrix.unity-prefix == '2019.' }} | |
run: | | |
"m_EditorVersion: ${{ steps.version-select.outputs.version }}`nm_EditorVersionWithRevision: ${{ steps.version-select.outputs.version }} (${{ steps.version-select.outputs.changeset }})" ` | |
| Out-File "samples\unity-of-bugs\ProjectSettings\ProjectVersion.txt" | |
- name: Update ci-env.ps1 | |
run: | | |
$file = "scripts/ci-env.ps1" | |
$regexVersion = '${{ matrix.unity-prefix }}'.Replace(".", "\.") + "[0-9.a-z]+" | |
echo "Regex: $regexVersion" | |
(Get-Content $file) -replace $regexVersion, '${{ steps.version-select.outputs.version }}' | Out-File $file | |
- run: git --no-pager diff | |
- name: Create PR | |
uses: peter-evans/create-pull-request@f22a7da129c901513876a2380e2dae9f8e145330 | |
with: | |
branch: chore/unity-${{ steps.version-select.outputs.version }} | |
commit-message: 'chore: update to Unity ${{ steps.version-select.outputs.version }}' | |
title: 'Update to Unity ${{ steps.version-select.outputs.version }}' | |
base: main | |
body: | | |
#skip-changelog | |
Auto-generated by [create-pull-request](https://github.com/peter-evans/create-pull-request) | |
labels: Repository Maintenance |