Skip to content

Commit c7fca78

Browse files
authored
feat: updated mac actions workflow (#71)
1 parent ae1dd2f commit c7fca78

File tree

4 files changed

+114
-45
lines changed

4 files changed

+114
-45
lines changed

.github/workflows/build-linux.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@ jobs:
4848
GITHUB_RUN_NUMBER: ${{ github.run_number }}
4949
run: npm run package:linux:snap
5050

51+
- name: Publish to Snap Store
52+
continue-on-error: true
53+
env:
54+
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}
55+
run: |
56+
snapcraft upload --release stable dist/**/*.snap
57+
5158
- name: Upload artifacts
5259
uses: actions/upload-artifact@v4
5360
with:

.github/workflows/build-mac.yml

Lines changed: 72 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,24 @@ on:
33
push:
44
tags:
55
- 'v*.*.*'
6+
workflow_dispatch:
7+
inputs:
8+
version:
9+
description: 'Version number (e.g., 1.0.0)'
10+
required: true
11+
type: string
612

713
jobs:
814
mac:
915
name: macos
10-
runs-on: macos-latest
16+
runs-on: macos-14
1117
permissions:
1218
contents: write
19+
env:
20+
APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }}
21+
APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }}
22+
APPLE_API_KEY_BASE64: ${{ secrets.APPLE_API_KEY_BASE64 }}
23+
CSC_KEY_PASSWORD: ${{ secrets.APPLE_CERTIFICATES_BUNDLE_PASSWORD }}
1324
steps:
1425
- name: Checkout repository
1526
uses: actions/checkout@v4
@@ -22,42 +33,48 @@ jobs:
2233
- name: Install dependencies
2334
run: npm ci
2435

25-
- name: Set version from tag
36+
- name: Determine version variables
2637
env:
2738
GITHUB_REF: ${{ github.ref }}
28-
run: npm version "${GITHUB_REF#refs/tags/v}" --no-git-tag-version --allow-same-version
39+
VERSION_INPUT: ${{ github.event.inputs.version }}
40+
run: |
41+
if [ -n "$VERSION_INPUT" ]; then
42+
# Manual trigger with version input
43+
VERSION="$VERSION_INPUT"
44+
else
45+
# Tag trigger
46+
VERSION="${GITHUB_REF#refs/tags/v}"
47+
fi
48+
VERSION_WITHOUT_PRERELEASE=$(echo "$VERSION" | sed 's/-.*//')
49+
50+
echo "VERSION=$VERSION" >> $GITHUB_ENV
51+
echo "VERSION_WITHOUT_PRERELEASE=$VERSION_WITHOUT_PRERELEASE" >> $GITHUB_ENV
52+
53+
echo "Determined VERSION: $VERSION"
54+
echo "Determined VERSION_WITHOUT_PRERELEASE: $VERSION_WITHOUT_PRERELEASE"
55+
56+
- name: Set version from tag or input
57+
run: npm version "$VERSION" --no-git-tag-version --allow-same-version
2958

3059
- name: Build
3160
run: npm run build
3261

3362
- name: Install Apple Code Signing Certificate
3463
env:
35-
APPLE_THIRD_PARTY_INSTALLER_SIGNING_CERTIFICATE_BASE64: ${{ secrets.APPLE_3RD_PARTY_INSTALLER_SIGNING_CERTIFICATE_BASE64 }}
36-
APPLE_THIRD_PARTY_SIGNING_CERTIFICATE_BASE64: ${{ secrets.APPLE_3RD_PARTY_SIGNING_CERTIFICATE_BASE64 }}
37-
BUILD_CERTIFICATE_BASE64: ${{ secrets.APPLE_SIGNING_CERTIFICATE_BASE64 }}
38-
P12_PASSWORD: ${{ secrets.APPLE_SIGNING_CERTIFICATE_PASSWORD }}
39-
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
64+
APPLE_CERTIFICATES_BUNDLE_BASE64: ${{ secrets.APPLE_CERTIFICATES_BUNDLE_BASE64 }}
65+
APPLE_CERTIFICATES_BUNDLE_PATH: ${{ runner.temp }}/apple_certificates_bundle.p12
4066
run: |
41-
THIRD_PARTY_INSTALLER_CERTIFICATE_PATH=$RUNNER_TEMP/3rd_party_installer_certificate.p12
42-
THIRD_PARTY_CERTIFICATE_PATH=$RUNNER_TEMP/3rd_party_certificate.p12
43-
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
44-
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
45-
46-
# import certificate and provisioning profile from secrets
47-
echo -n "$APPLE_THIRD_PARTY_INSTALLER_SIGNING_CERTIFICATE_BASE64" | base64 --decode -o $THIRD_PARTY_INSTALLER_CERTIFICATE_PATH
48-
echo -n "$APPLE_THIRD_PARTY_SIGNING_CERTIFICATE_BASE64" | base64 --decode -o $THIRD_PARTY_CERTIFICATE_PATH
49-
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH
50-
51-
# create temporary keychain
52-
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
53-
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
54-
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
55-
56-
# import certificate to keychain
57-
security import $THIRD_PARTY_INSTALLER_CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
58-
security import $THIRD_PARTY_CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
59-
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
60-
security list-keychain -d user -s $KEYCHAIN_PATH
67+
echo -n "$APPLE_CERTIFICATES_BUNDLE_BASE64" | base64 --decode -o $APPLE_CERTIFICATES_BUNDLE_PATH
68+
echo "CSC_LINK=$APPLE_CERTIFICATES_BUNDLE_PATH" >> $GITHUB_ENV
69+
70+
- name: Install Apple API key
71+
run: |
72+
mkdir -p ~/private_keys/
73+
74+
KEY_PATH=~/private_keys/AuthKey_$APPLE_API_KEY_ID.p8
75+
76+
echo -n "$APPLE_API_KEY_BASE64" | base64 --decode -o $KEY_PATH
77+
echo "APPLE_API_KEY=$KEY_PATH" >> $GITHUB_ENV
6178
6279
- name: Install Mac Profiles
6380
env:
@@ -69,23 +86,40 @@ jobs:
6986
7087
- name: Package (Mac)
7188
env:
72-
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
73-
APPLE_ID: ${{ secrets.APPLE_ID }}
74-
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }}
7589
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7690
run: npm run package:mac:publish
7791

78-
- name: Set version from tag (without pre-release)
79-
env:
80-
GITHUB_REF: ${{ github.ref }}
81-
run: |
82-
VERSION=$(echo "${GITHUB_REF#refs/tags/v}" | sed 's/-.*//')
83-
npm version "$VERSION" --no-git-tag-version --allow-same-version
92+
- name: Set version from tag or input (without pre-release)
93+
run: npm version "$VERSION_WITHOUT_PRERELEASE" --no-git-tag-version --allow-same-version
8494

8595
- name: Package (Mac App Store)
8696
env:
8797
GITHUB_RUN_NUMBER: ${{ github.run_number }}
88-
run: npm run package:mac:store
98+
run: |
99+
echo "Packaging for Mac App Store..."
100+
npm run package:mac:store
101+
102+
- name: Submit to App Store Connect
103+
continue-on-error: true
104+
run: |
105+
echo "Submitting to App Store Connect..."
106+
107+
PKG_FILE=$(find dist -name "*.pkg" -type f | head -1)
108+
if [[ -z "$PKG_FILE" ]]; then
109+
echo "Error: No .pkg file found in dist directory"
110+
exit 1
111+
fi
112+
113+
echo "Found package: $PKG_FILE"
114+
115+
xcrun altool \
116+
--upload-app \
117+
--file "$PKG_FILE" \
118+
--type macos \
119+
--apiKey "$APPLE_API_KEY_ID" \
120+
--apiIssuer "$APPLE_API_ISSUER" \
121+
--output-format xml \
122+
--show-progress
89123
90124
- name: Upload artifacts
91125
uses: actions/upload-artifact@v4

README.md

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,20 @@ It allows you to visualize your MQTT topics, subscribe to them and publish messa
1919
You can simplify your development processes by using the built-in actions.
2020

2121
# Download
22-
| <img src='docs/platforms-logo/windows-logo.png' width='100'> | <img src='docs/platforms-logo/apple-logo.png' width='100'> | <img src='docs/platforms-logo/linux-logo.png' width='100'> | <img src='docs/platforms-logo/debian-logo.png' width='100'> |
23-
|:-----------------------------------------------------------------------------------------------------------------------------------:|:------------------------------------------------------------------------------------------------------------------------------:|:--------------------------------------------------------------------------------------------------:|:----------------------------------------------------------------------------------------:|
24-
| [Windows Portable](https://mq3t.guillaumechx.dev/download.html?os=windows&arch=x64&type=portable) | [Mac Apple Silicon](https://mq3t.guillaumechx.dev/download.html?os=mac&arch=arm64&type=dmg) | [AppImage (x64)](https://mq3t.guillaumechx.dev/download.html?os=linux&arch=x86_64&type=AppImage) | [Deb (x64)](https://mq3t.guillaumechx.dev/download.html?os=linux&arch=amd64&type=deb) |
25-
| [Windows Setup](https://mq3t.guillaumechx.dev/download.html?os=windows&arch=x64&type=setup) | [Mac Intel](https://mq3t.guillaumechx.dev/download.html?os=mac&arch=x64&type=dmg) | [AppImage (arm64)](https://mq3t.guillaumechx.dev/download.html?os=linux&arch=arm64&type=AppImage) | [Deb (arm64)](https://mq3t.guillaumechx.dev/download.html?os=linux&arch=arm64&type=deb) |
26-
| [<img src="docs/download-logo/microsoft-store.svg" alt="Alt Text" height="50">]( https://www.microsoft.com/store/apps/9N95JHMPSSQJ) | [<img src="docs/download-logo/mac-app-store.svg" alt="Alt Text" height="50">](https://apps.apple.com/fr/app/mq3t/id6479254709) | [AppImage (armv7)](https://mq3t.guillaumechx.dev/download.html?os=linux&arch=armv7l&type=AppImage) | [Deb (armv7)](https://mq3t.guillaumechx.dev/download.html?os=linux&arch=armv7l&type=deb) |
22+
23+
## Stores
24+
25+
| <img src='docs/platforms-logo/windows-logo.png' height='100'> | <img src='docs/platforms-logo/apple-logo.png' height='100'> | <img src='docs/platforms-logo/ubuntu-logo.svg' height='100'> |
26+
|:-----------------------------------------------------------------------------------------------------------------------------------------------:|:------------------------------------------------------------------------------------------------------------------------------------------:|:-----------------------------------------------------------------------------------------------------------------------------------------------------:|
27+
| [<img src="docs/download-logo/microsoft-store.svg" alt="Alt Text" height="50" width="172">]( https://www.microsoft.com/store/apps/9N95JHMPSSQJ) | [<img src="docs/download-logo/mac-app-store.svg" alt="Alt Text" height="50" width="196">](https://apps.apple.com/fr/app/mq3t/id6479254709) | <a href="https://snapcraft.io/mq3t"><img alt="Get it from the Snap Store" src=https://snapcraft.io/en/dark/install.svg height="50" width="164" /></a> |
28+
29+
## Installers
30+
31+
| <img src='docs/platforms-logo/windows-logo.png' height='100'> | <img src='docs/platforms-logo/apple-logo.png' height='100'> | <img src='docs/platforms-logo/linux-logo.png' height='100'> | <img src='docs/platforms-logo/debian-logo.png' height='100'> |
32+
|:-------------------------------------------------------------------------------------------------:|:-------------------------------------------------------------------------------------------:|:--------------------------------------------------------------------------------------------------:|:----------------------------------------------------------------------------------------:|
33+
| [Windows Portable](https://mq3t.guillaumechx.dev/download.html?os=windows&arch=x64&type=portable) | [Mac Apple Silicon](https://mq3t.guillaumechx.dev/download.html?os=mac&arch=arm64&type=dmg) | [AppImage (x64)](https://mq3t.guillaumechx.dev/download.html?os=linux&arch=x86_64&type=AppImage) | [Deb (x64)](https://mq3t.guillaumechx.dev/download.html?os=linux&arch=amd64&type=deb) |
34+
| [Windows Setup](https://mq3t.guillaumechx.dev/download.html?os=windows&arch=x64&type=setup) | [Mac Intel](https://mq3t.guillaumechx.dev/download.html?os=mac&arch=x64&type=dmg) | [AppImage (arm64)](https://mq3t.guillaumechx.dev/download.html?os=linux&arch=arm64&type=AppImage) | [Deb (arm64)](https://mq3t.guillaumechx.dev/download.html?os=linux&arch=arm64&type=deb) |
35+
| | | [AppImage (armv7)](https://mq3t.guillaumechx.dev/download.html?os=linux&arch=armv7l&type=AppImage) | [Deb (armv7)](https://mq3t.guillaumechx.dev/download.html?os=linux&arch=armv7l&type=deb) |
2736

2837
## Project Setup
2938

@@ -50,6 +59,7 @@ npm run dev
5059
- `src/` - Vue.js source code
5160
- `assets/` - Static assets
5261
- `components/` - Vue.js components
62+
- `composables/` - Vue.js composables
5363
- `store/` - Pinia store
5464
- `tabs/` - Application tabs
5565
- `App.vue` - Vue.js root component
@@ -58,15 +68,32 @@ npm run dev
5868

5969
## Build
6070

71+
### Build the application
72+
73+
```bash
74+
npm run build
75+
```
76+
77+
## Package
78+
6179
```bash
62-
# For windows
80+
# For windows (exe)
6381
npm run package:win
6482

65-
# For macOS
83+
# For windows (Microsoft Store)
84+
npm run package:win:store
85+
86+
# For macOS (dmg)
6687
npm run package:mac
6788

89+
# For macOS (App Store)
90+
npm run package:mac:store
91+
6892
# For Linux
6993
npm run package:linux
94+
95+
# For Snapcraft
96+
npm run package:linux:snap
7097
```
7198

7299
# License
Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)