Skip to content

Commit fa3a109

Browse files
authored
feat(ci): prepare 2.0.0-alpha.0 (#5786)
1 parent 1092865 commit fa3a109

File tree

6 files changed

+165
-2
lines changed

6 files changed

+165
-2
lines changed

.changes/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
"pipe": true
104104
},
105105
{
106-
"command": "yarn publish --access public --loglevel silly",
106+
"command": "yarn publish --access public --loglevel silly --tag next",
107107
"dryRunCommand": "npm publish --dry-run --access public",
108108
"pipe": true
109109
},

.changes/mobile.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
"api": major
3+
"tauri-utils": major
4+
"tauri-bundler": major
5+
"tauri-codegen": major
6+
"tauri-macros": major
7+
"tauri-build": major
8+
"tauri": major
9+
"cli.rs": major
10+
"cli.js": major
11+
---
12+
13+
First mobile alpha release!

.changes/pre.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"tag": "alpha",
3+
"changes": []
4+
}
Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
# Copyright 2019-2022 Tauri Programme within The Commons Conservancy
2+
# SPDX-License-Identifier: Apache-2.0
3+
# SPDX-License-Identifier: MIT
4+
5+
name: version or publish
6+
7+
on:
8+
push:
9+
branches:
10+
- next
11+
12+
jobs:
13+
run-integration-tests:
14+
runs-on: ${{ matrix.platform }}
15+
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
platform: [ubuntu-latest, macos-latest, windows-latest]
20+
21+
steps:
22+
- uses: actions/checkout@v2
23+
with:
24+
fetch-depth: 0
25+
- name: install stable
26+
uses: actions-rs/toolchain@v1
27+
with:
28+
toolchain: stable
29+
- name: install Linux dependencies
30+
if: matrix.platform == 'ubuntu-latest'
31+
run: |
32+
sudo apt-get update
33+
sudo apt-get install -y webkit2gtk-4.0 libayatana-appindicator3-dev libfuse2
34+
35+
- uses: Swatinem/rust-cache@v2
36+
with:
37+
workspaces: |
38+
core -> ../target
39+
tooling/cli
40+
41+
- name: build CLI
42+
uses: actions-rs/cargo@v1
43+
with:
44+
command: build
45+
args: --manifest-path ./tooling/cli/Cargo.toml
46+
47+
- name: run integration tests
48+
run: cargo test --test '*' -- --ignored
49+
50+
- name: run CLI tests
51+
timeout-minutes: 30
52+
run: |
53+
cd ./tooling/cli/node
54+
yarn
55+
yarn build
56+
yarn test
57+
58+
version-or-publish:
59+
runs-on: ubuntu-latest
60+
timeout-minutes: 65
61+
outputs:
62+
change: ${{ steps.covector.outputs.change }}
63+
commandRan: ${{ steps.covector.outputs.commandRan }}
64+
successfulPublish: ${{ steps.covector.outputs.successfulPublish }}
65+
needs:
66+
- run-integration-tests
67+
68+
steps:
69+
- uses: actions/checkout@v2
70+
with:
71+
fetch-depth: 0
72+
- uses: actions/setup-node@v2
73+
with:
74+
node-version: 14
75+
registry-url: 'https://registry.npmjs.org'
76+
cache: yarn
77+
cache-dependency-path: tooling/*/yarn.lock
78+
79+
- name: cargo login
80+
run: cargo login ${{ secrets.ORG_CRATES_IO_TOKEN }}
81+
- name: git config
82+
run: |
83+
git config --global user.name "${{ github.event.pusher.name }}"
84+
git config --global user.email "${{ github.event.pusher.email }}"
85+
86+
- name: covector version or publish (publish when no change files present)
87+
uses: jbolda/covector/packages/action@covector-v0
88+
id: covector
89+
env:
90+
NODE_AUTH_TOKEN: ${{ secrets.ORG_NPM_TOKEN }}
91+
CARGO_AUDIT_OPTIONS: ${{ secrets.CARGO_AUDIT_OPTIONS }}
92+
with:
93+
token: ${{ secrets.GITHUB_TOKEN }}
94+
command: 'version-or-publish'
95+
createRelease: true
96+
97+
- name: Create Pull Request With Versions Bumped
98+
if: steps.covector.outputs.commandRan == 'version'
99+
uses: tauri-apps/create-pull-request@v3
100+
with:
101+
token: ${{ secrets.GITHUB_TOKEN }}
102+
branch: release/version-updates-next
103+
title: (NEXT) Apply Version Updates From Current Changes
104+
commit-message: 'apply version updates'
105+
labels: 'version updates'
106+
body: ${{ steps.covector.outputs.change }}
107+
108+
- name: Trigger doc update
109+
if: |
110+
steps.covector.outputs.successfulPublish == 'true' &&
111+
steps.covector.outputs.packagesPublished != ''
112+
uses: peter-evans/repository-dispatch@v1
113+
with:
114+
token: ${{ secrets.ORG_TAURI_BOT_PAT }}
115+
repository: tauri-apps/tauri-docs
116+
event-type: update-docs
117+
118+
- name: Trigger cli.js publishing workflow
119+
if: |
120+
steps.covector.outputs.successfulPublish == 'true' &&
121+
contains(steps.covector.outputs.packagesPublished, 'cli.rs')
122+
uses: peter-evans/repository-dispatch@v1
123+
with:
124+
token: ${{ secrets.ORG_TAURI_BOT_PAT }}
125+
repository: tauri-apps/tauri
126+
event-type: publish-clijs
127+
inputs: '{"releaseId": "${{ steps.covector.outputs.cli.js-releaseId }}" }'
128+
129+
- name: Trigger cli.rs publishing workflow
130+
if: |
131+
steps.covector.outputs.successfulPublish == 'true' &&
132+
contains(steps.covector.outputs.packagesPublished, 'cli.rs')
133+
uses: peter-evans/repository-dispatch@v1
134+
with:
135+
token: ${{ secrets.ORG_TAURI_BOT_PAT }}
136+
repository: tauri-apps/tauri
137+
event-type: publish-clirs

.scripts/covector/sync-cli-metadata.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ rust binaries.
1111
*/
1212

1313
const { readFileSync, writeFileSync } = require('fs')
14+
const { resolve } = require('path')
1415

1516
const packageNickname = process.argv[2]
1617
const filePath =
@@ -22,6 +23,7 @@ let index = null
2223

2324
switch (bump) {
2425
case 'major':
26+
case 'premajor':
2527
index = 0
2628
break
2729
case 'minor':
@@ -30,6 +32,9 @@ switch (bump) {
3032
case 'patch':
3133
index = 2
3234
break
35+
case 'prerelease':
36+
index = 3
37+
break
3338
default:
3439
throw new Error('unexpected bump ' + bump)
3540
}
@@ -43,6 +48,10 @@ const inc = (version) => {
4348
v[i] = 0
4449
}
4550
}
51+
if (bump === 'premajor') {
52+
const pre = JSON.parse(readFileSync(resolve(filePath, '../../../.changes/pre.json'), 'utf-8'))
53+
return `${v.join('.')}-${pre.tag}.0`
54+
}
4655
return v.join('.')
4756
}
4857

core/config-schema/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ edition = "2021"
55
publish = false
66

77
[build-dependencies]
8-
tauri-utils = { version = "1.0.0", features = [ "schema" ], path = "../tauri-utils" }
8+
tauri-utils = { path = "../tauri-utils", features = [ "schema" ] }
99
schemars = { version = "0.8", features = [ "url", "preserve_order" ] }
1010
serde = { version = "1.0", features = [ "derive" ] }
1111
serde_json = "1.0"

0 commit comments

Comments
 (0)