Skip to content

Commit 05f595f

Browse files
update workflows
1 parent 94e145a commit 05f595f

File tree

1 file changed

+30
-108
lines changed

1 file changed

+30
-108
lines changed

.github/workflows/main.yml

Lines changed: 30 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -1,118 +1,40 @@
1-
name: Release CI
2-
1+
name: "publish"
32
on:
43
push:
54
branches:
6-
- release # Push events to matching v*, i.e. v1.0, v20.15.10
5+
- master
76

87
jobs:
9-
build-chatgptstacks:
10-
runs-on: ${{ matrix.os }}
8+
publish-tauri:
119
strategy:
1210
fail-fast: false
1311
matrix:
14-
include:
15-
- build: macos
16-
os: macos-latest
17-
arch: x86_64
18-
target: x86_64-apple-darwin
19-
- build: macos
20-
os: macos-latest
21-
arch: aarch64
22-
target: aarch64-apple-darwin
23-
- build: windows
24-
os: windows-latest
25-
arch: x86_64
26-
target: x86_64-pc-windows-msvc
27-
28-
steps:
29-
- uses: actions/checkout@v3
30-
31-
- name: Install Node.js
32-
uses: actions/setup-node@v3
33-
with:
34-
node-version: 14
35-
36-
- name: 'Setup Rust'
37-
uses: dtolnay/rust-toolchain@stable
38-
with:
39-
targets: ${{ matrix.target }}
40-
- uses: Swatinem/rust-cache@v2
41-
with:
42-
key: ${{ matrix.target }}
43-
44-
- name: Install xattr (macos only)
45-
if: matrix.os == 'macos-latest'
46-
run: pip install xattr
47-
48-
- name: Install rust target
49-
run: rustup target add ${{ matrix.target }}
50-
51-
- run: yarn && yarn build && yarn tauri build --target ${{ matrix.target }}
52-
env:
53-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54-
55-
- uses: actions/upload-artifact@v3
56-
if: matrix.os == 'macos-latest'
57-
with:
58-
name: artifacts-${{ matrix.arch }}
59-
path: |
60-
./target/${{ matrix.target }}/release/bundle/dmg/**.dmg
61-
./target/${{ matrix.target }}/release/bundle/macos/**.app.*
12+
platform: [macos-latest, windows-latest]
6213

63-
- uses: actions/upload-artifact@v3
64-
if: matrix.os == 'windows-latest'
65-
with:
66-
name: artifacts-${{ matrix.arch }}
67-
path: |
68-
./target/${{ matrix.target }}/release/bundle/msi/**
69-
70-
release-chatgptstacks:
71-
needs: build-chatgptstacks
72-
runs-on: macos-latest
14+
runs-on: ${{ matrix.platform }}
7315
steps:
74-
- uses: actions/checkout@v3
75-
76-
- name: Install xattr
77-
run: |
78-
sudo apt-get update
79-
sudo apt-get install -y xattr
80-
81-
- name: Query version number
82-
run: echo "version=${GITHUB_REF:11}" >> $GITHUB_ENV
83-
84-
- name: Download x86_64 artifacts
85-
uses: actions/download-artifact@v3
86-
with:
87-
path: artifacts/x86_64
88-
89-
- name: Download aarch64 artifacts
90-
uses: actions/download-artifact@v3
91-
with:
92-
path: artifacts/aarch64
93-
94-
- name: Rename artifacts
95-
run: |
96-
mv "artifacts/aarch64/dmg/chatgptstacks_${{ env.version }}_aarch64.dmg" "artifacts/chatgptstacks_${{ env.version }}_macos_aarch64.dmg"
97-
mv "artifacts/aarch64/macos/chatgptstacks.app.tar.gz" "artifacts/chatgptstacks_${{ env.version }}_macos_aarch64.app.tar.gz"
98-
mv "artifacts/aarch64/macos/chatgptstacks.app.tar.gz.sig" "artifacts/chatgptstacks_${{ env.version }}_macos_aarch64.app.tar.gz.sig"
99-
100-
mv "artifacts/x86_64/dmg/chatgptstacks_${{ env.version }}_x64.dmg" "artifacts/chatgptstacks_${{ env.version }}_macos_x86_64.dmg"
101-
mv "artifacts/x86_64/macos/chatgptstacks.app.tar.gz" "artifacts/chatgptstacks_${{ env.version }}_macos_x86_64.app.tar.gz"
102-
mv "artifacts/x86_64/macos/chatgptstacks.app.tar.gz.sig" "artifacts/chatgptstacks_${{ env.version }}_macos_x86_64.app.tar.gz.sig"
103-
104-
mv "artifacts/x86_64/chatgptstacks_${{ env.version }}_x64_en-US.msi" "artifacts/chatgptstacks_${{ env.version }}_windows_x86_64.msi"
105-
mv "artifacts/x86_64/chatgptstacks_${{ env.version }}_x64_en-US.msi.zip" "artifacts/chatgptstacks_${{ env.version }}_windows_x86_64.msi.zip"
106-
mv "artifacts/x86_64/chatgptstacks_${{ env.version }}_x64_en-US.msi.zip.sig" "artifacts/chatgptstacks_${{ env.version }}_windows_x86_64.msi.zip.sig"
107-
108-
- name: Create Release
109-
uses: softprops/action-gh-release@master
110-
env:
111-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
112-
with:
113-
tag_name: v${{ env.version }}
114-
name: chatgptstacks v${{ env.version }}
115-
body: See the assets to download this version and install.
116-
prerelease: false
117-
generate_release_notes: false
118-
files: ./artifacts/**/*
16+
- uses: actions/checkout@v2
17+
- name: setup node
18+
uses: actions/setup-node@v1
19+
with:
20+
node-version: 16
21+
- name: install Rust stable
22+
uses: actions-rs/toolchain@v1
23+
with:
24+
toolchain: stable
25+
- name: install dependencies (ubuntu only)
26+
if: matrix.platform == 'ubuntu-latest'
27+
run: |
28+
sudo apt-get update
29+
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf
30+
- name: install app dependencies and build it
31+
run: yarn && yarn build && yarn tauri build
32+
- uses: tauri-apps/tauri-action@v0
33+
env:
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35+
with:
36+
tagName: chatgptstacks-v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version
37+
releaseName: "__VERSION__"
38+
releaseBody: "See the assets to download this version and install."
39+
releaseDraft: true
40+
prerelease: false

0 commit comments

Comments
 (0)