-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Henri Devigne
committed
Jun 1, 2024
1 parent
e643d6c
commit db539b7
Showing
2 changed files
with
115 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
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: Prepare DMG | ||
run: mkdir dmg && mv IPingTray.app dmg/ && ln -s /Applications dmg/Applications | ||
|
||
- name: Install create-dmg | ||
run: brew install create-dmg | ||
|
||
- name: Create DMG | ||
run: create-dmg IPingTray.dmg dmg | ||
|
||
- name: Upload DMG artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ipingtray-${{ env.arch }}.dmg | ||
path: IPingTray.dmg | ||
|
||
release: | ||
permissions: | ||
contents: write | ||
issues: write | ||
pull-requests: write | ||
needs: | ||
- macos-build | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 | ||
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 | ||
with: | ||
cache: npm | ||
node-version: lts/* | ||
|
||
- name: Download binaries | ||
uses: actions/download-artifact@v2 | ||
with: | ||
path: dist | ||
|
||
- name: "configure semantic-release" | ||
run: | | ||
npm install @semantic-release/github -D | ||
cat <<EOF > .releaserc.yml | ||
branches: | ||
- 'main' | ||
plugins: | ||
- '@semantic-release/commit-analyzer' | ||
- '@semantic-release/release-notes-generator' | ||
- '@semantic-release/github' | ||
- '@semantic-release/changelog' | ||
- "@semantic-release/git": | ||
message: "chore(release): v\${nextRelease.version}\n\n\${nextRelease.notes}" | ||
- "@semantic-release/github": | ||
assets: | ||
- path: dist/* | ||
publish: | ||
- '@semantic-release/gitlab' | ||
verifyConditions: | ||
- '@semantic-release/gitlab' | ||
success: false | ||
fail: false | ||
npmPublish: false | ||
EOF | ||
- run: npm clean-install | ||
- run: corepack npm audit signatures | ||
- run: npx [email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 |