Skip to content

Commit 1841ef4

Browse files
Automate updating SPM [skip ci]
1 parent 779f364 commit 1841ef4

File tree

3 files changed

+31
-13
lines changed

3 files changed

+31
-13
lines changed

.github/workflows/spm.yml

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,37 @@
1-
name: Update Package.resolved
1+
name: Update Swift Package
2+
23
on:
34
schedule:
4-
- cron: "0 0 * * 1"
5+
- cron: "30 22 * * *"
56
workflow_dispatch:
67

78
jobs:
8-
run:
9-
runs-on: macos-13
9+
update:
10+
runs-on: ubuntu-latest
11+
1012
steps:
11-
- uses: actions/checkout@v3
12-
- name: Update Package.resolved
13+
- name: Checkout to the branch
14+
uses: actions/checkout@v3
15+
- name: Update Swift Package
1316
run: |
1417
set -ex
15-
swift package update
16-
swift build
17-
git add Package.resolved
18-
git diff-index --quiet HEAD || git commit -m "Update Package.resolved"
19-
git push origin master
18+
19+
swift package update --package-path ./
20+
swift package update --package-path Resources/branch_main
21+
swift package update --package-path Resources/branch_release-5.9
22+
- name: Create Pull Request
23+
id: cpr
24+
uses: peter-evans/create-pull-request@v5
25+
with:
26+
token: ${{ secrets.GH_PAT }}
27+
base: "master"
28+
commit-message: "Update Swift Packages"
29+
title: "Update Swift Packages"
30+
add-paths: |
31+
Package.resolved
32+
**/Package.resolved
33+
- name: Enable Pull Request Automerge
34+
if: ${{ steps.cpr.outputs.pull-request-url }}
35+
run: gh pr merge --merge --auto ${{ steps.cpr.outputs.pull-request-url }}
36+
env:
37+
GH_TOKEN: ${{ secrets.GH_PAT }}

Resources/branch_main/Tests/Tests/Tests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@testable import parser
22
import XCTest
33

4-
final class AppTests: XCTestCase {
4+
final class Tests: XCTestCase {
55
func testParser1() throws {
66
let response = try SyntaxParser.parse(
77
code: """

Resources/branch_release-5.9/Tests/Tests/Tests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@testable import parser
22
import XCTest
33

4-
final class AppTests: XCTestCase {
4+
final class Tests: XCTestCase {
55
func testParser1() throws {
66
let response = try SyntaxParser.parse(
77
code: """

0 commit comments

Comments
 (0)