@@ -12,6 +12,9 @@ concurrency:
1212 group : ${{ github.ref_name }}
1313 cancel-in-progress : true
1414
15+ permissions :
16+ contents : write
17+
1518jobs :
1619 test-configure-script :
1720 name : Test configure.swift script and generate project
@@ -49,32 +52,26 @@ jobs:
4952 with :
5053 name : generated-project
5154 path : OUTPUT/TestModule/
52- test -generated-project :
53- name : Test generated project using template workflow
55+ deploy -generated-project :
56+ name : Deploy generated project to test branch
5457 needs : test-configure-script
55- runs-on : macos-15
58+ runs-on : ubuntu-latest
5659 timeout-minutes : 10
60+ if : github.event_name == 'push' && github.ref == 'refs/heads/main'
5761 steps :
58- - uses : actions/checkout@v4
59-
6062 - name : Download generated project
6163 uses : actions/download-artifact@v4
6264 with :
6365 name : generated-project
64- path : TestModule/
65-
66- - name : Select Xcode 16.1
67- run : sudo xcode-select -s /Applications/Xcode_16.1.app
68-
69- - name : Test generated Swift package
70- run : |
71- cd TestModule
72- swift build
73- swift test
66+ path : generated/
7467
75- - name : Test generated Example project
68+ - name : Push to production branch
7669 run : |
77- cd TestModule/Example
78- xcodebuild -project Example.xcodeproj -scheme Example -destination "platform=iOS Simulator,name=iPhone 15,OS=18.1" clean build
79- # delegate-to-template-workflow:
80- # Don't know how to do this
70+ cd generated
71+ git init
72+ git config user.name "GitHub Actions"
73+ git config user.email "[email protected] " 74+ git add .
75+ git commit -m "Generated project from main commit ${{ github.sha }}"
76+ git remote add origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
77+ git push -f origin HEAD:production
0 commit comments