Skip to content

Commit

Permalink
Add release action
Browse files Browse the repository at this point in the history
Signed-off-by: Ethan Dye <[email protected]>
  • Loading branch information
ecdye committed Oct 25, 2024
1 parent 18f7871 commit 6fa748b
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 5 deletions.
20 changes: 15 additions & 5 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ jobs:
echo "::set-output name=should_run::false"
fi
build:
name: Build
nightly:
name: Nightly Build
runs-on: macos-latest
needs: check_commit
if: ${{ needs.check_commit.outputs.should_run != 'false' }}
Expand All @@ -44,6 +44,12 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Import GPG key
uses: crazy-max/[email protected]
with:
gpg_private_key: "${{ secrets.RELEASE_GPG_PRIVATE_KEY }}"
passphrase: "${{ secrets.RELEASE_GPG_PASSPHRASE }}"

- name: Install FFmpeg
run: brew install ffmpeg

Expand All @@ -58,14 +64,18 @@ jobs:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
xcrun swift build --configuration release --arch arm64
tar -cvJf macSubtitleOCR.tar.xz -C .build/release/ macSubtitleOCR
tar -cvJf macSubtitleOCR-nightly-${{ github.ref_name }}.tar.xz -C .build/release/ macSubtitleOCR
gpg --detach-sign --armor macSubtitleOCR-nightly-${{ github.ref_name }}.tar.xz
gpg --verify macSubtitleOCR-nightly-${{ github.ref_name }}.tar.xz.asc macSubtitleOCR-nightly-${{ github.ref_name }}.tar.xz
gh release delete --yes --cleanup-tag nightly
- name: Publish
uses: softprops/action-gh-release@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: Nightly Build
tag_name: nightly
token: ${{ secrets.GITHUB_TOKEN }}
files: macSubtitleOCR.tar.xz
prerelease: true
files: |
macSubtitleOCR-nightly-${{ github.ref_name }}.tar.xz
macSubtitleOCR-nightly-${{ github.ref_name }}.tar.xz.asc
46 changes: 46 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Release

on:
push:
tags:
- "v*.*.*"

jobs:
release:
name: Release
runs-on: "macos-latest"
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Import GPG key
uses: crazy-max/[email protected]
with:
gpg_private_key: "${{ secrets.RELEASE_GPG_PRIVATE_KEY }}"
passphrase: "${{ secrets.RELEASE_GPG_PASSPHRASE }}"

- name: Install FFmpeg
run: brew install ffmpeg

- name: Select Xcode
uses: mxcl/xcodebuild@v3
with:
swift: '6.0'
action: none

- name: Build
run: |
xcrun swift build --configuration release --arch arm64
tar -cvJf macSubtitleOCR-${{ github.ref_name }}.tar.xz -C .build/release/ macSubtitleOCR
gpg --detach-sign --armor macSubtitleOCR-${{ github.ref_name }}.tar.xz
gpg --verify macSubtitleOCR-${{ github.ref_name }}.tar.xz.asc macSubtitleOCR-${{ github.ref_name }}.tar.xz
- name: Publish
uses: softprops/action-gh-release@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
generate_release_notes: true
make_latest: true
files: |
macSubtitleOCR-${{ github.ref_name }}.tar.xz
macSubtitleOCR-${{ github.ref_name }}.tar.xz.asc

0 comments on commit 6fa748b

Please sign in to comment.