Skip to content

Commit d895a3c

Browse files
committed
remove older architecture and more complex workflow
1 parent 1d7049b commit d895a3c

File tree

3 files changed

+60
-213
lines changed

3 files changed

+60
-213
lines changed

.github/workflows/release-simple.yml

Lines changed: 0 additions & 110 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 44 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -4,126 +4,96 @@ on:
44
workflow_dispatch:
55
inputs:
66
version:
7-
description: 'Version to release (e.g., v1.0.0)'
7+
description: 'Version to release (e.g., 1.0.0 - without v prefix)'
88
required: true
99
type: string
10-
draft:
11-
description: 'Create as draft release'
12-
required: false
13-
type: boolean
14-
default: true
15-
prerelease:
16-
description: 'Mark as pre-release'
17-
required: false
18-
type: boolean
19-
default: false
2010

2111
jobs:
2212
create-release:
2313
permissions:
2414
contents: write
2515
runs-on: ubuntu-latest
2616
outputs:
27-
release_id: ${{ steps.create-release.outputs.id }}
28-
upload_url: ${{ steps.create-release.outputs.upload_url }}
17+
release_id: ${{ steps.create-release.outputs.result }}
2918
steps:
3019
- uses: actions/checkout@v4
3120

21+
- name: Update version in Cargo.toml
22+
run: |
23+
sed -i 's/^version = ".*"/version = "${{ github.event.inputs.version }}"/' src-tauri/Cargo.toml
24+
25+
- name: Update version in tauri.conf.json
26+
run: |
27+
sed -i 's/"version": ".*"/"version": "${{ github.event.inputs.version }}"/' src-tauri/tauri.conf.json
28+
3229
- name: Create Release
3330
id: create-release
34-
uses: actions/create-release@v1
35-
env:
36-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
uses: actions/github-script@v7
3732
with:
38-
tag_name: ${{ github.event.inputs.version }}
39-
release_name: CCUsage macOS Menubar ${{ github.event.inputs.version }}
40-
draft: ${{ github.event.inputs.draft }}
41-
prerelease: ${{ github.event.inputs.prerelease }}
42-
body: |
43-
## What's Changed
44-
33+
github-token: ${{ secrets.GITHUB_TOKEN }}
34+
result-encoding: string
35+
script: |
36+
const { data } = await github.rest.repos.createRelease({
37+
owner: context.repo.owner,
38+
repo: context.repo.repo,
39+
tag_name: `v${{ github.event.inputs.version }}`,
40+
name: `CCUsage macOS Menubar v${{ github.event.inputs.version }}`,
41+
draft: true,
42+
prerelease: false,
43+
body: `## What's Changed
44+
4545
<!-- Update this section with actual changes -->
46-
46+
4747
## Installation
48-
48+
4949
### macOS
50-
1. Download the `.dmg` file for your architecture:
51-
- Apple Silicon (M1/M2/M3): `*_aarch64.dmg`
52-
- Intel: `*_x64.dmg`
50+
1. Download the \`.dmg\` file
5351
2. Open the DMG and drag the app to your Applications folder
5452
3. The app requires Node.js to be installed for ccusage functionality
5553
54+
**Compatibility**: Apple Silicon (M1/M2/M3) Macs only
55+
5656
### Requirements
5757
- macOS 10.15 or later
5858
- Node.js (for ccusage CLI functionality)
59-
60-
**Full Changelog**: https://github.com/${{ github.repository }}/compare/...v${{ github.event.inputs.version }}
59+
60+
**Note**: This build is not code-signed. You may need to right-click and select "Open" the first time you run it, or go to System Preferences > Security & Privacy to allow it to run.`
61+
});
62+
return data.id;
6163
6264
build-tauri:
6365
needs: create-release
6466
permissions:
6567
contents: write
66-
strategy:
67-
fail-fast: false
68-
matrix:
69-
include:
70-
- platform: 'macos-latest' # ARM64
71-
args: '--target aarch64-apple-darwin'
72-
- platform: 'macos-latest' # x64
73-
args: '--target x86_64-apple-darwin'
74-
75-
runs-on: ${{ matrix.platform }}
68+
runs-on: macos-latest
7669
steps:
7770
- uses: actions/checkout@v4
7871

72+
- name: Update version in Cargo.toml
73+
run: |
74+
sed -i '' 's/^version = ".*"/version = "${{ github.event.inputs.version }}"/' src-tauri/Cargo.toml
75+
76+
- name: Update version in tauri.conf.json
77+
run: |
78+
sed -i '' 's/"version": ".*"/"version": "${{ github.event.inputs.version }}"/' src-tauri/tauri.conf.json
79+
7980
- name: Setup Node.js
8081
uses: actions/setup-node@v4
8182
with:
8283
node-version: 20
83-
cache: 'yarn'
8484

8585
- name: Install Rust stable
8686
uses: dtolnay/rust-toolchain@stable
8787
with:
88-
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
88+
targets: aarch64-apple-darwin
8989

9090
- name: Install dependencies
9191
run: yarn install
9292

93-
- name: Build and Upload Release
93+
- name: Build Tauri App
9494
uses: tauri-apps/tauri-action@v0
9595
env:
9696
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
97-
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
98-
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
99-
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
100-
APPLE_ID: ${{ secrets.APPLE_ID }}
101-
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
102-
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
10397
with:
10498
releaseId: ${{ needs.create-release.outputs.release_id }}
105-
releaseBody: 'See the release notes for details.'
106-
releaseDraft: ${{ github.event.inputs.draft }}
107-
prerelease: ${{ github.event.inputs.prerelease }}
108-
args: ${{ matrix.args }}
109-
110-
publish-release:
111-
permissions:
112-
contents: write
113-
runs-on: ubuntu-latest
114-
needs: [create-release, build-tauri]
115-
if: github.event.inputs.draft == 'false'
116-
117-
steps:
118-
- name: Publish Release
119-
uses: actions/github-script@v7
120-
with:
121-
github-token: ${{ secrets.GITHUB_TOKEN }}
122-
script: |
123-
github.rest.repos.updateRelease({
124-
owner: context.repo.owner,
125-
repo: context.repo.repo,
126-
release_id: "${{ needs.create-release.outputs.release_id }}",
127-
draft: false,
128-
prerelease: ${{ github.event.inputs.prerelease }}
129-
})
99+
args: --target aarch64-apple-darwin

CLAUDE.md

Lines changed: 16 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -166,44 +166,31 @@ Quit
166166

167167
## GitHub Actions Release Workflow
168168

169-
Two release workflows are available:
170-
171-
### 1. release.yml (Full Release with Code Signing)
172-
Requires Apple Developer certificates. To use:
173-
1. Set up the following GitHub secrets:
174-
- `APPLE_CERTIFICATE`: Base64 encoded .p12 certificate
175-
- `APPLE_CERTIFICATE_PASSWORD`: Certificate password
176-
- `APPLE_SIGNING_IDENTITY`: Identity name from certificate
177-
- `APPLE_ID`: Apple Developer account email
178-
- `APPLE_PASSWORD`: App-specific password
179-
- `APPLE_TEAM_ID`: Apple Developer Team ID
180-
181-
2. Trigger manually from Actions tab:
182-
- Version: e.g., `v1.0.0`
183-
- Draft: Create as draft (default: true)
184-
- Pre-release: Mark as pre-release (default: false)
185-
186-
### 2. release-simple.yml (Simple Release without Code Signing)
187-
No Apple Developer account required. To use:
188-
1. Go to Actions tab on GitHub
189-
2. Select "Release (Simple)" workflow
169+
The project includes a GitHub Actions workflow for automated releases.
170+
171+
### Using the Release Workflow
172+
No Apple Developer account required. To create a release:
173+
174+
1. Go to the Actions tab on GitHub
175+
2. Select "Release" workflow
190176
3. Click "Run workflow"
191177
4. Enter version (e.g., `1.0.0` - without v prefix)
192178
5. The workflow will:
193179
- Update version in Cargo.toml and tauri.conf.json
194-
- Build for both ARM64 and x64 macOS
195-
- Create a draft release with DMG files
180+
- Build for Apple Silicon (ARM64) only
181+
- Create a draft release with the DMG file
196182
- Note: Users will need to bypass Gatekeeper on first run
197183

184+
### Requirements
185+
- Targets Apple Silicon Macs only (M1/M2/M3)
186+
- No code signing (users need to right-click → Open on first launch)
187+
- Requires Node.js installed on the user's machine for ccusage functionality
188+
198189
### Manual Release Process
199190
If you prefer to build and release manually:
200191
```bash
201-
# Build for current architecture
202-
yarn tauri build
203-
204-
# Build for specific architecture
205-
yarn tauri build -- --target aarch64-apple-darwin # ARM64
206-
yarn tauri build -- --target x86_64-apple-darwin # Intel
192+
# Build for Apple Silicon (ARM64)
193+
yarn tauri build -- --target aarch64-apple-darwin
207194

208195
# Output will be in:
209196
# src-tauri/target/release/bundle/dmg/

0 commit comments

Comments
 (0)