diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..2465839 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,66 @@ +name: Build + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + + workflow_dispatch: + +jobs: + build: + strategy: + fail-fast: true + matrix: + build: + - { name: 'TorPlayer-darwin', os: 'macos-latest' } + + runs-on: ${{ matrix.build.os }} + steps: + - name: Checkout + uses: actions/checkout@v4 + + # Setup Golang + - name: Setup Golang + uses: actions/setup-go@v4 + with: + go-version: 1.21 + check-latest: true + - run: go version + shell: bash + + # Build MacOS + - name: Build MacOS + if: runner.os == 'macOS' + run: | + mkdir -p ./build/bin/TorPlayer.app/Contents/MacOS + mkdir -p ./build/bin/TorPlayer.app/Contents/Resources + cp ./build/darwin/Info.plist ./build/bin/TorPlayer.app/Contents + cp ./build/darwin/iconfile.icns ./build/bin/TorPlayer.app/Contents/Resources + go build -o build/bin/TorPlayer.app/Contents/MacOS/TorPlayer + chmod +x build/bin/*/Contents/MacOS/* + shell: bash + + # Package MacOS + - name: Package MacOS + if: runner.os == 'macOS' + run: | + productbuild --component ./build/bin/TorPlayer.app ./build/bin/TorPlayer.pkg + shell: bash + + # Upload build assets + - uses: actions/upload-artifact@v4 + with: + name: Wails Build ${{runner.os}} ${{matrix.build.name}} + path: | + */bin/*.pkg + *\bin\*.exe + - name: Release + uses: softprops/action-gh-release@v1 + if: inputs.package == 'true' && startsWith(github.ref, 'refs/tags/') + with: + files: | + */bin/*.{pkg,exe} + + diff --git a/.gitignore b/.gitignore index a9fecf7..809479b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .idea -**/.DS_Store \ No newline at end of file +**/.DS_Store +build/bin diff --git a/build/darwin/Info.plist b/build/darwin/Info.plist new file mode 100644 index 0000000..789524b --- /dev/null +++ b/build/darwin/Info.plist @@ -0,0 +1,29 @@ + + + + CFBundlePackageType + APPL + CFBundleName + TorPlayer + CFBundleExecutable + TorPlayer + CFBundleIdentifier + com.TorPlayer + CFBundleVersion + 1.0.0 + CFBundleGetInfoString + Built using Go + CFBundleShortVersionString + 1.0.0 + CFBundleIconFile + iconfile + LSMinimumSystemVersion + 10.13.0 + NSHighResolutionCapable + true + NSHumanReadableCopyright + Copyright......... + + + + diff --git a/build/darwin/iconfile.icns b/build/darwin/iconfile.icns new file mode 100644 index 0000000..59243e6 Binary files /dev/null and b/build/darwin/iconfile.icns differ