Snap upstream releases #279
Workflow file for this run
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: Snap upstream releases | |
on: | |
workflow_dispatch: # Allow manual run | |
workflow_call: # Allow calling from another workflow | |
schedule: | |
- cron: "0 6 * * *" # Every day at 06:00 UTC | |
concurrency: ${{ github.workflow }} | |
permissions: | |
contents: write | |
packages: write | |
issues: write | |
pull-requests: write | |
jobs: | |
sync-gh-releases: | |
name: Sync upstream releases | |
uses: lengau/snappify/.github/workflows/sync-gh-releases.yaml@c29366560f49fb1e20cca823654c87d81678ce0a | |
with: | |
upstream_repository: astral-sh/ruff | |
max_releases: 2 | |
prep_script: tools/prep_release.sh | |
do-releases: | |
name: Release ${{ matrix.tag }} | |
runs-on: ubuntu-latest | |
needs: sync-gh-releases | |
if: ${{ needs.sync-gh-releases.outputs.release_tags != '[]' && needs.sync-gh-releases.outputs.release_tags != '' }} | |
strategy: | |
max-parallel: 1 | |
matrix: | |
tag: ${{ fromJSON(needs.sync-gh-releases.outputs.release_tags) }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ matrix.tag }} | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
name: Ruff ${{ matrix.tag }} | |
body: See upstream release at https://github.com/charliermarsh/ruff/releases/tag/${{ matrix.tag }} | |
prerelease: ${{ contains(matrix.tag, 'pre') }} | |
tag_name: ${{ matrix.tag }} | |
sync-to-core24: # Sync changes from main to the core24 branch. | |
needs: sync-gh-releases | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node # Needed for the sync-branches action | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 12 | |
- name: Sync branches | |
id: sync-pr | |
uses: TreTuna/[email protected] | |
with: | |
GITHUB_TOKEN: ${{ github.token }} | |
FROM_BRANCH: "main" | |
TO_BRANCH: "core24" | |
CONTENT_COMPARISON: true | |
REVIEWERS: '["lengau"]' | |
PULL_REQUEST_AUTO_MERGE_METHOD: merge | |
- name: Merge PR if possible | |
run: | | |
if [[ ${{ steps.sync-pr.outputs.PULL_REQUEST_NUMBER }} ]]; then | |
gh pr merge ${{ steps.sync-pr.outputs.PULL_REQUEST_NUMBER }} | |
fi | |