Skip to content

Commit 6657c70

Browse files
committed
feat: 0.7.0
1 parent fe37a48 commit 6657c70

File tree

4 files changed

+208
-15
lines changed

4 files changed

+208
-15
lines changed

.github/workflows/main-build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
name: Build
1+
name: MainBuild
22

33
on:
44
push:
55
branches:
6-
- main
6+
- mainx
77

88
jobs:
99
build:

.github/workflows/pro-build.yml

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
name: ProBuild
2+
3+
on:
4+
push:
5+
tags:
6+
- v*.*.*
7+
8+
jobs:
9+
build:
10+
runs-on: ${{ matrix.os }}
11+
12+
strategy:
13+
matrix:
14+
include:
15+
- os: ubuntu-latest
16+
arch: [ arm64, amd64 ]
17+
- os: macos-latest
18+
arch: [ arm64, amd64 ]
19+
- os: windows-latest
20+
arch: [ arm64, amd64 ]
21+
22+
steps:
23+
- name: Checkout Code
24+
uses: actions/checkout@v4
25+
26+
- name: Git clone repo
27+
if: runner.os == 'Linux' || runner.os == 'macOS'
28+
env:
29+
GIT_USER: ${{ secrets.GIT_USER }}
30+
GIT_PASS: ${{ secrets.GIT_PASS }}
31+
GIT_REPO_BASE: ${{ secrets.GIT_REPO_BASE }}
32+
GIT_HOST: ${{ secrets.GIT_HOST }}
33+
run: |
34+
git clone -b main "https://${GIT_USER}:${GIT_PASS}@${GIT_HOST}/${GIT_REPO_BASE}/linkandroid-pro.git" code
35+
36+
- name: Git clone repo
37+
if: runner.os == 'Windows'
38+
env:
39+
GIT_USER: ${{ secrets.GIT_USER }}
40+
GIT_PASS: ${{ secrets.GIT_PASS }}
41+
GIT_REPO_BASE: ${{ secrets.GIT_REPO_BASE }}
42+
GIT_HOST: ${{ secrets.GIT_HOST }}
43+
shell: pwsh
44+
run: |
45+
git clone -b main "https://${env:GIT_USER}:${env:GIT_PASS}@${env:GIT_HOST}/${env:GIT_REPO_BASE}/linkandroid-pro.git" code
46+
47+
- name: Setup Node.js
48+
uses: actions/setup-node@v4
49+
with:
50+
node-version: 20
51+
52+
- name: Build Prepare (macOS)
53+
if: runner.os == 'macOS'
54+
run: |
55+
brew install python-setuptools
56+
57+
- name: Cert Prepare (macOS)
58+
if: runner.os == 'macOS'
59+
env:
60+
MACOS_CERTIFICATE: ${{ secrets.CORP_MACOS_CERTIFICATE }}
61+
MACOS_CERTIFICATE_PASSWORD: ${{ secrets.CORP_MACOS_CERTIFICATE_PASSWORD }}
62+
run: |
63+
echo "find-identity"
64+
security find-identity -p codesigning
65+
echo "$MACOS_CERTIFICATE" | base64 --decode > certificate.p12
66+
security create-keychain -p "" build.keychain
67+
security import certificate.p12 -k build.keychain -P "$MACOS_CERTIFICATE_PASSWORD" -T /usr/bin/codesign
68+
security list-keychains -s build.keychain
69+
security set-keychain-settings -t 3600 -u build.keychain
70+
security unlock-keychain -p "" build.keychain
71+
echo "find-identity"
72+
security find-identity -v -p codesigning build.keychain
73+
echo "find-identity"
74+
security find-identity -p codesigning
75+
echo "set-key-partition-list"
76+
security set-key-partition-list -S apple-tool:,apple: -s -k "" -l "Mac Developer ID Application: Xi'an Yanyi Information Technology Co., Ltd" -t private build.keychain
77+
echo "export"
78+
security export -k build.keychain -t certs -f x509 -p -o certificate.cer
79+
echo "add-trusted-cert"
80+
sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain certificate.cer
81+
echo "find-identity"
82+
security find-identity -p codesigning
83+
84+
- name: Install Dependencies
85+
working-directory: code
86+
run: npm install
87+
88+
- name: Build Release Files
89+
working-directory: code
90+
run: |
91+
npm run build
92+
env:
93+
DEBUG: "electron-notarize:*"
94+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
95+
APPLE_ID: ${{ secrets.APPLE_ID }}
96+
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
97+
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
98+
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
99+
100+
- name: Set Build Name ( Linux / macOS )
101+
if: runner.os == 'Linux' || runner.os == 'macOS'
102+
run: |
103+
DIST_FILE_NAME=${{ runner.os }}-${{ runner.arch }}-v$(date +%Y%m%d_%H%M%S)-${RANDOM}
104+
echo ::add-mask::$DIST_FILE_NAME
105+
echo DIST_FILE_NAME=$DIST_FILE_NAME >> $GITHUB_ENV
106+
107+
- name: Set Build Name ( Windows )
108+
if: runner.os == 'Windows'
109+
shell: pwsh
110+
run: |
111+
$randomNumber = Get-Random -Minimum 10000 -Maximum 99999
112+
$DIST_FILE_NAME = "Windows-X64-v$(Get-Date -Format 'yyyyMMdd_HHmmss')-$randomNumber"
113+
Write-Host "::add-mask::$DIST_FILE_NAME"
114+
echo "DIST_FILE_NAME=$DIST_FILE_NAME" >> $env:GITHUB_ENV
115+
116+
- name: Rename output files (Linux/macOS)
117+
if: runner.os == 'Linux' || runner.os == 'macOS'
118+
run: |
119+
find code/dist-release/ -type f -name 'LinkAndroidPro-*' -exec bash -c 'f="{}"; mv "$f" "${f/LinkAndroidPro-/LinkAndroid-}"' \;
120+
121+
- name: Rename output files (Windows)
122+
if: runner.os == 'Windows'
123+
shell: pwsh
124+
run: |
125+
Get-ChildItem code\dist-release\LinkAndroidPro-* | Rename-Item -NewName { $_.Name -replace 'LinkAndroidPro-','LinkAndroid-' }
126+
127+
- name: Release Assets
128+
uses: softprops/action-gh-release@v2
129+
with:
130+
draft: false
131+
prerelease: false
132+
fail_on_unmatched_files: false
133+
files: |
134+
code/dist-release/*.exe
135+
code/dist-release/*.dmg
136+
code/dist-release/*.AppImage
137+
code/dist-release/*.deb
138+
env:
139+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}

.github/workflows/tag-release.yml

Lines changed: 66 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build
1+
name: TagRelease
22

33
on:
44
push:
@@ -73,17 +73,70 @@ jobs:
7373
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
7474
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
7575

76-
- name: Release Assets
77-
uses: softprops/action-gh-release@v2
76+
- name: Set Build Name ( Linux / macOS )
77+
if: runner.os == 'Linux' || runner.os == 'macOS'
78+
run: |
79+
DIST_FILE_NAME=${{ runner.os }}-${{ runner.arch }}-v$(date +%Y%m%d_%H%M%S)-${RANDOM}
80+
echo ::add-mask::$DIST_FILE_NAME
81+
echo DIST_FILE_NAME=$DIST_FILE_NAME >> $GITHUB_ENV
82+
83+
- name: Set Build Name ( Windows )
84+
if: runner.os == 'Windows'
85+
shell: pwsh
86+
run: |
87+
$randomNumber = Get-Random -Minimum 10000 -Maximum 99999
88+
$DIST_FILE_NAME = "Windows-X64-v$(Get-Date -Format 'yyyyMMdd_HHmmss')-$randomNumber"
89+
Write-Host "::add-mask::$DIST_FILE_NAME"
90+
echo "DIST_FILE_NAME=$DIST_FILE_NAME" >> $env:GITHUB_ENV
91+
92+
- name: Upload
93+
uses: modstart/github-oss-action@master
7894
with:
79-
draft: false
80-
prerelease: false
81-
fail_on_unmatched_files: false
82-
files: |
83-
dist-release/*.exe
84-
dist-release/*.dmg
85-
dist-release/*.AppImage
86-
dist-release/*.deb
87-
env:
88-
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
95+
title: ${{ github.event.head_commit.message }}
96+
key-id: ${{ secrets.OSS_2_KEY_ID }}
97+
key-secret: ${{ secrets.OSS_2_KEY_SECRET }}
98+
region: ${{ secrets.OSS_2_REGION }}
99+
bucket: ${{ secrets.OSS_2_BUCKET }}
100+
callback: ${{ secrets.OSS_2_CALLBACK }}
101+
assets: |
102+
dist-release/*.exe:apps/linkandroid-${{ env.DIST_FILE_NAME }}/
103+
dist-release/*.dmg:apps/linkandroid-${{ env.DIST_FILE_NAME }}/
104+
dist-release/*.AppImage:apps/linkandroid-${{ env.DIST_FILE_NAME }}/
105+
dist-release/*.deb:apps/linkandroid-${{ env.DIST_FILE_NAME }}/
106+
107+
# - name: Upload Artifact Windows
108+
# if: runner.os == 'Windows'
109+
# uses: actions/upload-artifact@v4
110+
# with:
111+
# name: windows-artifact
112+
# path: |
113+
# dist-release/*.exe
114+
#
115+
# - name: Upload Artifact Macos
116+
# if: runner.os == 'macOS'
117+
# uses: actions/upload-artifact@v4
118+
# with:
119+
# name: macos-artifact
120+
# path: |
121+
# dist-release/*.dmg
122+
#
123+
# - name: Upload Artifact Linux
124+
# if: runner.os == 'Linux'
125+
# uses: actions/upload-artifact@v4
126+
# with:
127+
# name: linux-artifact
128+
# path: |
129+
# dist-release/*.AppImage
130+
# dist-release/*.deb
131+
#
132+
# - name: Release Assets
133+
# uses: softprops/action-gh-release@v2
134+
# with:
135+
# draft: false
136+
# prerelease: false
137+
# fail_on_unmatched_files: false
138+
# files: |
139+
# dist-release/*.yml
140+
# env:
141+
# GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
89142

data-changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/Users/mz/data/project/linkandroid/linkandroid/changelog.md

0 commit comments

Comments
 (0)