-
Notifications
You must be signed in to change notification settings - Fork 1
135 lines (116 loc) · 4.17 KB
/
release_cli_vscode.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
name: Release CLI and VSCode Extension
on:
push:
branches:
- main
tags:
- v*
pull_request:
branches:
- main
workflow_dispatch:
permissions:
contents: read
env:
TOMBI_VERSION: null
jobs:
delete-old-dev-artifacts:
runs-on: ubuntu-latest
steps:
- uses: geekyeggo/delete-artifact@v5
with:
name: |
tombi-cli-0.0.0-*
tombi-vscode-0.0.0-*
release-cli-and-vscode:
needs: [delete-old-dev-artifacts]
strategy:
matrix:
include:
- os: ubuntu-20.04
target: x86_64-unknown-linux-gnu
vscode_target: linux-x64
#
# FIXME: fails to build on those targets
#
# - os: ubuntu-20.04
# target: aarch64-unknown-linux-gnu
# vscode_target: linux-arm64
# - os: ubuntu-20.04
# target: arm-unknown-linux-gnueabihf
# vscode_target: linux-armhf
- os: windows-latest
target: x86_64-pc-windows-msvc
vscode_target: win32-x64
- os: windows-latest
target: aarch64-pc-windows-msvc
vscode_target: win32-arm64
- os: macos-13
target: x86_64-apple-darwin
vscode_target: darwin-x64
- os: macos-14
target: aarch64-apple-darwin
vscode_target: darwin-arm64
name: dist (${{ matrix.target }})
runs-on: ${{ matrix.os }}
env:
TOMBI_TARGET: ${{ matrix.target }}
VSCODE_TARGET: ${{ matrix.vscode_target }}
GITHUB_REF: ${{ (github.ref) }}
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
run: |
rustup update --no-self-update stable
rustup target add ${{ matrix.target }}
- uses: pnpm/action-setup@v4
with:
run_install: false
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- name: Update apt repositories
if: matrix.target == 'aarch64-unknown-linux-gnu' || matrix.target == 'arm-unknown-linux-gnueabihf'
run: sudo apt-get update
- name: Install AArch64 target toolchain
if: matrix.target == 'aarch64-unknown-linux-gnu'
run: sudo apt-get install gcc-aarch64-linux-gnu
- name: Install ARM target toolchain
if: matrix.target == 'arm-unknown-linux-gnueabihf'
run: sudo apt-get install gcc-arm-linux-gnueabihf
- run: pnpm install && pnpm run build
working-directory: ./editors/vscode
- run: which pnpm
- name: Run xtask set-version on non-Windows
if: matrix.os != 'windows-latest'
run: cargo xtask set-version >> $GITHUB_ENV
- name: Run xtask set-version on Windows
if: matrix.os == 'windows-latest'
run: cargo xtask set-version >> $env:GITHUB_ENV
- name: Get TOMBI_VERSION
if: matrix.os != 'windows-latest'
run: echo "TOMBI_VERSION=${{ env.TOMBI_VERSION }}"
- name: Rub xtask dist
run: cargo xtask dist
env:
RUST_BACKTRACE: "1"
# FIXME: pnpm cannot exec `cargo xtask dist` on windows.
# See https://github.com/matklad/xshell/issues/82
- name: Package VSCode Extension for Windows
if: matrix.os == 'windows-latest'
run: pnpm exec vsce package --no-dependencies -o "../../dist/tombi-vscode-${{ env.TOMBI_VERSION }}-${{ matrix.vscode_target }}.vsix" --target ${{ matrix.vscode_target }}
working-directory: ./editors/vscode
- name: Publish VSCode Extension
run: pnpm run publish --pat ${{ secrets.VSCODE_MARKETPLACE_TOKEN }} --packagePath "../../dist/tombi-vscode-${{ env.TOMBI_VERSION }}-${{ matrix.vscode_target }}.vsix"
if: startsWith(github.ref, 'refs/tags/')
working-directory: ./editors/vscode
- name: Upload tombi-vscode artifacts
uses: actions/upload-artifact@v4
if: startsWith(github.ref, 'refs/tags/')
with:
name: tombi-vscode-${{ env.TOMBI_VERSION }}-${{ matrix.target }}
path: |
dist/tombi-cli-${{ env.TOMBI_VERSION }}-*
dist/tombi-vscode-${{ env.TOMBI_VERSION }}-*