Skip to content

Commit

Permalink
ci: add release action
Browse files Browse the repository at this point in the history
  • Loading branch information
Henri Devigne committed Jun 2, 2024
1 parent e643d6c commit 4dff0c6
Show file tree
Hide file tree
Showing 4 changed files with 125 additions and 1 deletion.
70 changes: 70 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Release
on:
push:
branches:
- main

permissions:
contents: read

jobs:
macos-build:
runs-on: macos-13
steps:
- 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
cp build/macos/Info.plist IpingTray.app/Contents/Info.plist
- name: Install create-dmg
run: brew install create-dmg

- name: Prepare DMG
run: |
mkdir dmg
mv iPingTray.app dmg/iPingTray.app
ln -s /Applications dmg/Applications
create-dmg iPingTray.dmg dmg
- name: Upload DMG artifact
uses: actions/upload-artifact@v4
with:
name: iPingTray.dmg
path: iPingTray.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 }}
7 changes: 6 additions & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,9 @@ jobs:
- name: Super-linter
uses: super-linter/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
commitlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: wagoid/commitlint-github-action@v6
21 changes: 21 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"branches": ["main"],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"@semantic-release/github",
{
"assets": [
{ "path": "dist" }
]
}
],
"@semantic-release/github"
],
"publish": ["@semantic-release/github"],
"verifyConditions": ["@semantic-release/github"],
"success": false,
"fail": false,
"npmPublish": false
}
28 changes: 28 additions & 0 deletions build/macos/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>IPingTray</string>
<key>CFBundleExecutable</key>
<string>MacOS/IPingTray.app</string>
<key>CFBundleIdentifier</key>
<string>Appify by Machine Box.IPingTray</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>CFBundleGetInfoString</key>
<string>IPingTray by Appify by Machine Box</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleIconFile</key>
<string>icon.icns</string>

<!-- avoid showing the app on the Dock -->
<key>LSUIElement</key>
<string>1</string>
</dict>
</plist>

0 comments on commit 4dff0c6

Please sign in to comment.