ci: release not work #23
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: Release | |
on: | |
push: | |
branches: | |
- main | |
permissions: | |
contents: read | |
jobs: | |
macos-build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ macos-13, macos-14 ] | |
steps: | |
- name: Determine architecture | |
id: architecture | |
run: echo "arch=$(uname -m)" >> "${GITHUB_ENV}" | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: '1.22' | |
- run: go build -o ipingtray | |
- run: go install github.com/machinebox/appify@latest | |
- name: Create macOS app | |
run: appify -name "IPingTray" -icon docs/icon.png ipingtray | |
- name: Install create-dmg | |
run: brew install create-dmg | |
- name: Import certificate | |
run: | | |
echo "${{ secrets.MACOS_CERTIFICATE }}" | base64 --decode > certificate.p12 | |
security create-keychain -p "actions" build.keychain | |
security import certificate.p12 -k build.keychain -T /usr/bin/codesign | |
security list-keychains -s build.keychain | |
security unlock-keychain -p "actions" build.keychain | |
- name: Code sign the app | |
run: codesign --deep --force --verbose --sign "Self-Signed Developer" --keychain build.keychain IPingTray.app | |
- name: Prepare DMG | |
run: | | |
mkdir dmg | |
mv IPingTray.app dmg/ipingtray-${{ env.arch }}.app | |
ln -s /Applications dmg/Applications | |
create-dmg ipingtray-${{ env.arch }}.dmg dmg | |
xattr -cr ipingtray-${{ env.arch }}.dmg | |
- name: Upload DMG artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ipingtray-${{ env.arch }}.dmg | |
path: ipingtray-${{ env.arch }}.dmg | |
release: | |
permissions: | |
contents: write | |
issues: write | |
pull-requests: write | |
needs: | |
- macos-build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Download binaries | |
uses: actions/download-artifact@v4 | |
with: | |
path: dist | |
- run: find . | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: latest | |
- name: "configure semantic-release" | |
run: npm install -D semantic-release @semantic-release/github | |
- name: Semantic Release | |
uses: cycjimmy/semantic-release-action@v4 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |