Update Swift Package #627
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 Swift Package | |
on: | |
schedule: | |
- cron: "30 22 * * *" | |
workflow_dispatch: | |
jobs: | |
update: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout to the branch | |
uses: actions/checkout@v4 | |
- name: Swift Version | |
id: swift-version | |
run: echo "SWIFT_VERSION=$(cat .swift-version)" >> "$GITHUB_OUTPUT" | |
- name: Install Swift | |
uses: slashmo/[email protected] | |
with: | |
version: ${{ steps.swift-version.outputs.SWIFT_VERSION }} | |
- name: Update Swift Package | |
run: | | |
set -ex | |
export TOOLCHAINS=swift | |
swift package update --package-path ./ | |
swift package update --package-path Examples/SwiftPackage/ | |
swift package update --package-path Playground/ | |
- name: Create Pull Request | |
id: cpr | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
token: ${{ secrets.GH_PAT }} | |
base: "main" | |
commit-message: "Update Swift Packages" | |
title: "Update Swift Packages" | |
add-paths: | | |
Package.resolved | |
**/Package.resolved | |
- name: Enable Pull Request Automerge | |
if: ${{ steps.cpr.outputs.pull-request-url }} | |
run: gh pr merge --merge --auto ${{ steps.cpr.outputs.pull-request-url }} | |
env: | |
GH_TOKEN: ${{ secrets.GH_PAT }} |