Using Python Framework Now #13
This file contains hidden or 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: Release Latest Build | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| jobs: | |
| update-submodules: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout main with submodules | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| fetch-depth: 0 | |
| - name: Update orphan branches in submodules | |
| run: | | |
| git submodule foreach --recursive ' | |
| echo "Updating $name..." | |
| git remote set-url origin $(git config --file $toplevel/.gitmodules submodule.$name.url) | |
| git fetch origin | |
| git checkout -B latest-release origin/latest-release | |
| git pull origin latest-release || echo "Nothing to pull for $name" | |
| ' | |
| - name: Commit updated submodules | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git add . | |
| git commit -m "Update submodules from orphan branches" || echo "No changes" | |
| git push origin main | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| release: | |
| runs-on: macos-latest | |
| needs: [update-submodules] | |
| steps: | |
| - name: Checkout with submodules | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: Make shell script executable | |
| run: chmod +x ./build | |
| - name: Run build script | |
| run: ./build | |
| - name: Clean up source files | |
| run: | | |
| find . -mindepth 1 -maxdepth 1 ! -name 'GSInstallerMac.zip' ! -name '.git' -exec rm -rf {} + | |
| - name: Version File | |
| run: | | |
| date +%s > version | |
| - name: Set up Git | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git checkout --orphan latest-release | |
| - name: Commit and push changes | |
| run: | | |
| git add . | |
| git commit -m "Latest build $(date "+%Y-%m-%d %H:%M:%S")" | |
| git push -f origin latest-release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |