-
-
Notifications
You must be signed in to change notification settings - Fork 0
190 lines (165 loc) · 6.1 KB
/
covector-version-or-publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
name: covector version or publish
on:
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
version-or-release:
runs-on: ubuntu-latest
outputs:
willPublish: ${{ steps.covector-status.outputs.willPublish-pisano }}
version: ${{ steps.covector-status.outputs.version-pisano }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: covector status
uses: jbolda/covector/packages/action@covector-v0
id: covector-status
with:
command: 'status'
- name: git config
if: ${{ steps.covector-status.outputs.status != 'No changes.' }}
run: |
git config --global user.name "${{ github.event.pusher.name }}"
git config --global user.email "${{ github.event.pusher.email }}"
- name: covector version
uses: jbolda/covector/packages/action@covector-v0
id: covector-version
if: ${{ steps.covector-status.outputs.status != 'No changes.' }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
command: 'version'
- name: Create Pull Request With Versions Bumped
id: cpr
uses: peter-evans/create-pull-request@v5
if: ${{ steps.covector-status.outputs.status != 'No changes.' }}
with:
title: 'Publish New Versions'
commit-message: 'publish new versions'
labels: 'version updates'
branch: 'release'
body: ${{ steps.covector-version.outputs.change }}
build-binaries:
runs-on: ${{ matrix.config.os }}
needs: [version-or-release]
if: needs.version-or-release.outputs.willPublish
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
config:
- os: ubuntu-latest
arch: x86_64
rust_target: x86_64-unknown-linux-gnu
- os: macos-latest
arch: x86_64
rust_target: x86_64-apple-darwin
- os: macos-latest
arch: aarch64
rust_target: aarch64-apple-darwin
- os: windows-latest
arch: x86_64
rust_target: x86_64-pc-windows-msvc
steps:
- uses: actions/checkout@v3
- name: 'Setup Rust'
uses: actions-rs/toolchain@v1
with:
default: true
override: true
profile: minimal
toolchain: stable
target: ${{ matrix.config.rust_target }}
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.config.rust_target }}
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16
- uses: pnpm/[email protected]
name: Install pnpm
id: pnpm-install
with:
version: 7
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-${{ matrix.config.arch }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-${{ matrix.config.arch }}-pnpm-store-
- uses: pnpm/[email protected]
with:
run_install: true
- name: install webkit2gtk (ubuntu only)
if: matrix.config.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y webkit2gtk-4.0 libgtk-3-dev
# - name: create apple private key file
# if: "matrix.config.os == 'macos-latest'"
# run: |
# mkdir ./desktop/app/private_keys
# echo "$APPLE_API_PRIVKEY" > ./desktop/app/private_keys/AuthKey_$APPLE_API_KEY.p8
# env:
# APPLE_API_PRIVKEY: '${{ secrets.APPLE_API_PRIVKEY }}'
# APPLE_API_KEY: '${{ secrets.APPLE_API_KEY }}'
- uses: JonasKruckenberg/[email protected]
id: tauri_build
env:
VERSION: ${{ needs.get-version.outputs.version }}
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
# ENABLE_CODE_SIGNING: '${{ secrets.APPLE_CERTIFICATE }}'
# APPLE_API_ISSUER: '${{ secrets.APPLE_API_ISSUER }}'
# APPLE_API_KEY: '${{ secrets.APPLE_API_KEY }}'
# APPLE_CERTIFICATE: '${{ secrets.APPLE_CERTIFICATE }}'
# APPLE_CERTIFICATE_PASSWORD:
# '${{ secrets.APPLE_CERTIFICATE_PASSWORD }}'
# APPLE_SIGNING_IDENTITY: '${{ secrets.APPLE_SIGNING_IDENTITY }}'
# TAURI_KEY_PASSWORD: '${{ secrets.TAURI_KEY_PASSWORD }}'
# TAURI_PRIVATE_KEY: '${{ secrets.TAURI_PRIVATE_KEY }}'
with:
target: ${{ matrix.config.rust_target }}
args: --verbose
- uses: actions/upload-artifact@v3
with:
name: artifacts-${{ matrix.config.arch }}
path: "${{ join(fromJSON(steps.tauri_build.outputs.artifacts), '\n') }}"
publish-to-github:
needs: [version-or-release, build-binaries]
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v3
- name: Download x86_64 artifacts
uses: actions/download-artifact@v3
with:
name: artifacts-x86_64
path: artifacts/x86_64
- name: Download aarch64 artifacts
uses: actions/download-artifact@v3
with:
name: artifacts-aarch64
path: artifacts/aarch64
- name: Rename .app artifacts
run: |
mv "./artifacts/x86_64/macos/Pisano.app.tar.gz" "./artifacts/x86_64/macos/Pisano_${{ needs.version-or-release.outputs.version }}_x86.app.tar.gz"
mv "./artifacts/aarch64/macos/Pisano.app.tar.gz" "./artifacts/aarch64/macos/Pisano_${{ needs.version-or-release.outputs.version }}_aarch64.app.tar.gz"
- name: 'create release'
uses: softprops/action-gh-release@master
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
with:
tag_name: v${{ needs.version-or-release.outputs.version }}
generate_release_notes: true
files: ./artifacts/**/*