Skip to content

Commit 67b49e8

Browse files
authored
Merge macOS port (PR #1)
macOS port: rewrite as pure-Python menu bar app
2 parents 33d8e36 + 0404ebd commit 67b49e8

31 files changed

Lines changed: 1624 additions & 17 deletions

.github/workflows/release.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: release
2+
3+
# Trigger model: this workflow is triggered ONLY by manual dispatch.
4+
# Click "Run workflow" in the Actions tab on GitHub.com (or run
5+
# `gh workflow run release.yml -f version=2.0.1`
6+
# from the CLI), enter the new version, and the workflow will:
7+
# 1. Bump version files
8+
# 2. Commit + tag + push to main
9+
# 3. Run the test suite
10+
# 4. Build LinkBridge.app
11+
# 5. Package as a zip with ditto
12+
# 6. Create a draft GitHub Release with auto-generated notes
13+
on:
14+
workflow_dispatch:
15+
inputs:
16+
version:
17+
description: 'New version (e.g. 2.0.1, 2.1.0). Do NOT prefix with "v".'
18+
required: true
19+
type: string
20+
21+
permissions:
22+
contents: write
23+
24+
jobs:
25+
release:
26+
runs-on: macos-latest
27+
28+
steps:
29+
- name: Checkout main
30+
uses: actions/checkout@v4
31+
with:
32+
ref: main
33+
fetch-depth: 0 # full history so auto-generated release notes can diff against the previous tag
34+
35+
- name: Configure git identity
36+
run: |
37+
git config user.name "github-actions[bot]"
38+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
39+
40+
- name: Set up Python 3.11
41+
uses: actions/setup-python@v5
42+
with:
43+
python-version: '3.11'
44+
45+
- name: Create venv and install dependencies
46+
run: |
47+
python3.11 -m venv venv
48+
venv/bin/pip install --upgrade pip
49+
venv/bin/pip install -r requirements.txt -r requirements-dev.txt
50+
51+
- name: Run tests (sanity check)
52+
run: venv/bin/pytest -v
53+
54+
- name: Bump version files
55+
run: venv/bin/bump-my-version replace --new-version "${{ inputs.version }}"
56+
57+
- name: Show diff after bump
58+
run: git diff
59+
60+
- name: Commit, tag, push
61+
run: |
62+
git add linkbridge/__init__.py setup.py
63+
git commit -m "chore: release v${{ inputs.version }}"
64+
git tag -a "v${{ inputs.version }}" -m "Release v${{ inputs.version }}"
65+
git push origin main
66+
git push origin "v${{ inputs.version }}"
67+
68+
- name: Build LinkBridge.app
69+
run: ./scripts/build_app.sh
70+
71+
- name: Package .app as a zip with ditto
72+
run: |
73+
cd dist
74+
ditto -c -k --keepParent LinkBridge.app "LinkBridge-v${{ inputs.version }}.zip"
75+
ls -la
76+
77+
- name: Create draft GitHub Release
78+
env:
79+
GH_TOKEN: ${{ github.token }}
80+
run: |
81+
gh release create "v${{ inputs.version }}" \
82+
--repo "${{ github.repository }}" \
83+
--title "LinkBridge v${{ inputs.version }}" \
84+
--generate-notes \
85+
--draft \
86+
"dist/LinkBridge-v${{ inputs.version }}.zip"

.github/workflows/test.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: tests
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
jobs:
9+
test:
10+
runs-on: macos-latest
11+
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
16+
- name: Set up Python 3.11
17+
uses: actions/setup-python@v5
18+
with:
19+
python-version: '3.11'
20+
21+
- name: Create venv and install dependencies
22+
run: |
23+
python3.11 -m venv venv
24+
venv/bin/pip install --upgrade pip
25+
venv/bin/pip install -r requirements.txt -r requirements-dev.txt
26+
27+
- name: Run pytest
28+
run: venv/bin/pytest -v

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
*.so
22
venv/
3-
TODO
3+
TODO
4+
__pycache__/
5+
*.py[cod]
6+
build/
7+
dist/
8+
assets/LinkBridge.iconset/
9+
assets/icon-1024.png

0 commit comments

Comments
 (0)