-
Notifications
You must be signed in to change notification settings - Fork 2
61 lines (52 loc) · 1.9 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Release
on:
push:
tags:
- "v*.*.*"
jobs:
release:
name: Release
runs-on: "macos-latest"
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v6.2.0
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'
action: none
- name: Build Standalone
id: build
run: |
TAG=${{ github.ref_name }}
echo "version=${TAG#v}" >> $GITHUB_ENV
xcrun swift build --configuration release --arch arm64
tar -cvJf macSubtitleOCR-${TAG}.tar.xz -C .build/release/ macSubtitleOCR
gpg --detach-sign --armor macSubtitleOCR-${TAG}.tar.xz
gpg --verify macSubtitleOCR-${TAG}.tar.xz.asc macSubtitleOCR-${TAG}.tar.xz
- name: Build with FFmpeg
run: |
TAG=${{ github.ref_name }}
USE_FFMPEG=1 xcrun swift build -Xswiftc -DFFMPEG --configuration release --arch arm64
tar -cvJf macSubtitleOCR-ffmpeg-${TAG}.tar.xz -C .build/release/ macSubtitleOCR
gpg --detach-sign --armor macSubtitleOCR-ffmpeg-${TAG}.tar.xz
gpg --verify macSubtitleOCR-ffmpeg-${TAG}.tar.xz.asc macSubtitleOCR-ffmpeg-${TAG}.tar.xz
- name: Publish
uses: softprops/action-gh-release@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: macSubtitleOCR ${{ steps.build.outputs.version }}
generate_release_notes: true
make_latest: true
files: |
macSubtitleOCR*${{ github.ref_name }}.tar.xz
macSubtitleOCR*${{ github.ref_name }}.tar.xz.asc