Nightly Build #7
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: Nightly Build | |
on: | |
workflow_dispatch: # Allows manual trigger | |
schedule: | |
- cron: '0 0 * * *' | |
jobs: | |
check_commit: | |
name: Check latest commit | |
runs-on: ubuntu-latest | |
outputs: | |
should_run: ${{ steps.should_run.outputs.should_run }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Check latest commit | |
id: should_run | |
continue-on-error: true | |
if: ${{ github.event_name == 'schedule' }} | |
run: test -z $(git rev-list --after="24 hours" ${{ github.sha }}) && echo "::set-output name=should_run::false" | |
build: | |
name: Build | |
runs-on: macos-latest | |
needs: check_commit | |
if: ${{ needs.check_commit.outputs.should_run != 'false' }} | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Select Xcode | |
uses: mxcl/xcodebuild@v3 | |
with: | |
xcode: 16.0 | |
swift: 6.0 | |
action: none | |
- name: Build | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
xcrun swift build --configuration release --arch arm64 --arch x86_64 | |
tar -cvJf macSubtitleOCR.tar.xz -C .build/apple/Products/Release macSubtitleOCR | |
gh release delete --yes --cleanup-tag nightly | |
- name: Publish | |
uses: softprops/action-gh-release@v2 | |
with: | |
name: Nightly Build | |
tag_name: nightly | |
token: ${{ secrets.GITHUB_TOKEN }} | |
files: macSubtitleOCR.tar.xz | |
prerelease: true |