Skip to content

Commit 82199ba

Browse files
committed
split publish workflow
1 parent 36341d5 commit 82199ba

4 files changed

Lines changed: 124 additions & 95 deletions

File tree

.changes/alpha.1.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"create-tauri-app": "patch"
3+
---
4+
5+
2.0.0-alpha.1

.github/workflows/covector-version-or-publish.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,24 @@ jobs:
6464
labels: 'version updates'
6565
body: ${{ steps.covector.outputs.change }}
6666

67-
- name: Trigger publish.yml workflow
67+
- name: Trigger publish-binaries.yml workflow
6868
if: |
6969
steps.covector.outputs.successfulPublish == 'true' &&
7070
contains(steps.covector.outputs.packagesPublished, 'create-tauri-app')
7171
uses: benc-uk/workflow-dispatch@v1 # TODO: adjust before merging for stable 2.0 maybe use repository dispatch???
7272
with:
73-
workflow: publish binaries and napi modules
73+
workflow: publish binaries
74+
repo: tauri-apps/create-tauri-app
75+
inputs: '{"releaseId": ${{ steps.covector.outputs.releaseId }} }'
76+
token: ${{ secrets.TAURI_BOT_PAT }}
77+
78+
- name: Trigger publish-napi.yml workflow
79+
if: |
80+
steps.covector.outputs.successfulPublish == 'true' &&
81+
contains(steps.covector.outputs.packagesPublished, 'create-tauri-app-js')
82+
uses: benc-uk/workflow-dispatch@v1 # TODO: adjust before merging for stable 2.0 maybe use repository dispatch???
83+
with:
84+
workflow: publish napi modules
7485
repo: tauri-apps/create-tauri-app
7586
inputs: '{"releaseId": ${{ steps.covector.outputs.releaseId }} }'
7687
token: ${{ secrets.TAURI_BOT_PAT }}
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
name: publish binaries
2+
3+
env:
4+
MACOSX_DEPLOYMENT_TARGET: '10.13'
5+
6+
on:
7+
workflow_dispatch: # TODO: adjust before merging for stable 2.0, maybe use repository_dispatch
8+
inputs:
9+
releasedId:
10+
description: 'Relasee Id'
11+
required: true
12+
type: number
13+
14+
jobs:
15+
build:
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
settings:
20+
- host: macos-latest
21+
target: x86_64-apple-darwin
22+
- host: macos-latest
23+
target: aarch64-apple-darwin
24+
- host: windows-latest
25+
target: x86_64-pc-windows-msvc
26+
ext: .exe
27+
- host: windows-latest
28+
target: i686-pc-windows-msvc
29+
ext: .exe
30+
- host: ubuntu-18.04
31+
target: x86_64-unknown-linux-gnu
32+
- host: ubuntu-18.04
33+
target: x86_64-unknown-linux-musl
34+
- host: ubuntu-18.04
35+
target: aarch64-unknown-linux-gnu
36+
- host: ubuntu-18.04
37+
target: armv7-unknown-linux-gnueabihf
38+
setup: |
39+
sudo apt-get update
40+
sudo apt-get install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf -y
41+
- host: ubuntu-18.04
42+
target: aarch64-unknown-linux-musl
43+
44+
name: ${{ matrix.settings.target }}
45+
runs-on: ${{ matrix.settings.host }}
46+
steps:
47+
- uses: actions/checkout@v3
48+
49+
- uses: actions-rs/toolchain@v1
50+
with:
51+
profile: minimal
52+
override: true
53+
toolchain: stable
54+
target: ${{ matrix.settings.target }}
55+
56+
- name: setup system dependencies
57+
run: ${{ matrix.settings.setup }}
58+
if: ${{ matrix.settings.setup }}
59+
shell: bash
60+
61+
- name: build
62+
uses: actions-rs/cargo@v1
63+
with:
64+
command: build
65+
args: --release
66+
67+
- name: upload artifact
68+
uses: actions/upload-artifact@v3
69+
with:
70+
name: "${{ matrix.settings.target }}"
71+
path: "target/release/create-tauri-app${{ matrix.settings.ext }}"
72+
if-no-files-found: error
73+
74+
publish:
75+
needs:
76+
- build
77+
runs-on: ubuntu-latest
78+
steps:
79+
- uses: actions/checkout@v3
80+
81+
- name: download all artifacts
82+
uses: actions/download-artifact@v3
83+
with:
84+
path: binaries
85+
86+
- name: rename files
87+
working-directory: binaries
88+
shell: bash
89+
run: |
90+
find . -name 'create-tauri-app*' -print0 | while read -d '' file
91+
do
92+
parent="$(basename $(dirname ${file}))"
93+
target="${file#./}"
94+
target="${target/create-tauri-app/create-tauri-app-${parent}}"
95+
target="${target/${parent}\//}"
96+
mv $file $target
97+
done
98+
find . -type d -empty -delete
99+
100+
- uses: xresloader/upload-to-github-release@v1
101+
env:
102+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
103+
with:
104+
release_id: "${{ inputs.releasedId }}"
105+
file: "binaries/*"
Lines changed: 1 addition & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: publish binaries and napi modules
1+
name: publish napi modules
22

33
env:
44
DEBUG: napi:*
@@ -15,65 +15,6 @@ on:
1515

1616
jobs:
1717
build:
18-
strategy:
19-
fail-fast: false
20-
matrix:
21-
settings:
22-
- host: macos-latest
23-
target: x86_64-apple-darwin
24-
- host: macos-latest
25-
target: aarch64-apple-darwin
26-
- host: windows-latest
27-
target: x86_64-pc-windows-msvc
28-
ext: .exe
29-
- host: windows-latest
30-
target: i686-pc-windows-msvc
31-
ext: .exe
32-
- host: ubuntu-18.04
33-
target: x86_64-unknown-linux-gnu
34-
- host: ubuntu-18.04
35-
target: x86_64-unknown-linux-musl
36-
- host: ubuntu-18.04
37-
target: aarch64-unknown-linux-gnu
38-
- host: ubuntu-18.04
39-
target: armv7-unknown-linux-gnueabihf
40-
setup: |
41-
sudo apt-get update
42-
sudo apt-get install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf -y
43-
- host: ubuntu-18.04
44-
target: aarch64-unknown-linux-musl
45-
46-
name: ${{ matrix.settings.target }}
47-
runs-on: ${{ matrix.settings.host }}
48-
steps:
49-
- uses: actions/checkout@v3
50-
51-
- uses: actions-rs/toolchain@v1
52-
with:
53-
profile: minimal
54-
override: true
55-
toolchain: stable
56-
target: ${{ matrix.settings.target }}
57-
58-
- name: setup system dependencies
59-
run: ${{ matrix.settings.setup }}
60-
if: ${{ matrix.settings.setup }}
61-
shell: bash
62-
63-
- name: build
64-
uses: actions-rs/cargo@v1
65-
with:
66-
command: build
67-
args: --release
68-
69-
- name: upload artifact
70-
uses: actions/upload-artifact@v3
71-
with:
72-
name: "${{ matrix.settings.target }}"
73-
path: "target/release/create-tauri-app${{ matrix.settings.ext }}"
74-
if-no-files-found: error
75-
76-
build-napi:
7718
defaults:
7819
run:
7920
working-directory: node
@@ -217,39 +158,6 @@ jobs:
217158
if-no-files-found: error
218159

219160
publish:
220-
needs:
221-
- build
222-
runs-on: ubuntu-latest
223-
steps:
224-
- uses: actions/checkout@v3
225-
226-
- name: download all artifacts
227-
uses: actions/download-artifact@v3
228-
with:
229-
path: binaries
230-
231-
- name: rename files
232-
working-directory: binaries
233-
shell: bash
234-
run: |
235-
find . -name 'create-tauri-app*' -print0 | while read -d '' file
236-
do
237-
parent="$(basename $(dirname ${file}))"
238-
target="${file#./}"
239-
target="${target/create-tauri-app/create-tauri-app-${parent}}"
240-
target="${target/${parent}\//}"
241-
mv $file $target
242-
done
243-
find . -type d -empty -delete
244-
245-
- uses: xresloader/upload-to-github-release@v1
246-
env:
247-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
248-
with:
249-
release_id: "${{ inputs.releasedId }}"
250-
file: "binaries/*"
251-
252-
publish-napi:
253161
defaults:
254162
run:
255163
working-directory: node

0 commit comments

Comments
 (0)