generated from astahmer/tailwind-to-css-in-js
-
Notifications
You must be signed in to change notification settings - Fork 1
177 lines (152 loc) · 4.77 KB
/
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
name: Release
on:
push:
branches: [main]
paths:
- ".changeset/**"
- "packages/tw2panda/**"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Setup Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Install pnpm
uses: pnpm/[email protected]
with:
version: 8
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build
working-directory: ./packages/tw2panda
run: pnpm build
- name: Test
working-directory: ./packages/tw2panda
run: pnpm test
# - name: Release to dev tag
# if: steps.changesets.outputs.published != 'true'
# run: |
# git checkout main
# pnpm changeset version --snapshot dev
# pnpm changeset publish --tag dev
# env:
# NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
# NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
publish: pnpm release
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
create_timestamp:
runs-on: ubuntu-latest
outputs:
timestamp: ${{ steps.set_timestamp.outputs.timestamp }}
steps:
- name: Set Timestamp
id: set_timestamp
run: |
echo "::set-output name=timestamp::$(date +'%s')"
release-extension:
name: VSCode Marketplace
needs: create_timestamp
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
target: win32-x64
npm_config_arch: x64
- os: windows-latest
target: win32-ia32
npm_config_arch: ia32
- os: windows-latest
target: win32-arm64
npm_config_arch: arm
- os: ubuntu-latest
target: linux-x64
npm_config_arch: x64
- os: ubuntu-latest
target: linux-arm64
npm_config_arch: arm64
- os: ubuntu-latest
target: linux-armhf
npm_config_arch: arm
- os: ubuntu-latest
target: alpine-x64
npm_config_arch: x64
- os: macos-latest
target: darwin-x64
npm_config_arch: x64
- os: macos-latest
target: darwin-arm64
npm_config_arch: arm64
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: pnpm/[email protected]
with:
version: 8
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18.x
registry-url: "https://registry.npmjs.org"
cache: "pnpm"
- name: Setup Git User
shell: bash
run: |
git config --global user.email "[email protected]"
git config --global user.name "Alexandre Stahmer"
- name: Install dependencies
shell: bash
run: pnpm install --frozen-lockfile
- name: Build packages
run: pnpm build
- name: Set Environment Variable
run: echo "VSCE_RELEASE_VERSION=$(date +'%s')" >> $GITHUB_ENV
- name: Overrides esbuild
working-directory: ./packages/vscode
if: contains(matrix.target, 'darwin-arm64')
run: pnpm override-esbuild
- name: Rewrite workspace deps
working-directory: ./packages/vscode
run: pnpm rewrite-deps
- name: Clean node_modules on windows
working-directory: ./packages/vscode
if: contains(matrix.target, 'win')
run: pnpm clean:windows
- name: Clean node_modules
working-directory: ./packages/vscode
if: "!(contains(matrix.target, 'win'))"
run: pnpm clean
- name: Install with workspace-less
working-directory: ./packages/vscode
run: |
pnpm i --ignore-scripts --ignore-workspace --shamefully-hoist --force
env:
npm_config_arch: ${{ matrix.npm_config_arch }}
- name: Publish RC
working-directory: ./packages/vscode
run: |
pnpm release
env:
VSCE_TOKEN: ${{secrets.VSCE_TOKEN}}
VSCE_RELEASE_VERSION: ${{ needs.create_timestamp.outputs.timestamp }}
VSCE_RELEASE_TYPE: stable
VSCE_TARGET: ${{ matrix.target }}