Skip to content

Commit d6bb1ac

Browse files
committed
chore: build platform specific packages
1 parent 48e8861 commit d6bb1ac

File tree

2 files changed

+141
-24
lines changed

2 files changed

+141
-24
lines changed

.github/workflows/build-check.yml

Lines changed: 71 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ on:
1313
env:
1414
GITLAB_NPM_TOKEN: ${{secrets.GITLAB_NPM_TOKEN}}
1515
jobs:
16-
build-check:
16+
lint:
1717
permissions: read-all
1818
runs-on: ubuntu-latest
1919
strategy:
@@ -34,20 +34,81 @@ jobs:
3434
run: npm run lint
3535
- name: 'Testing(Unit)'
3636
run: npm run test:unit
37+
package:
38+
strategy:
39+
matrix:
40+
include:
41+
- os: windows-latest
42+
platform: win32
43+
arch: x64
44+
npm_config_arch: x64
45+
- os: windows-latest
46+
platform: win32
47+
arch: ia32
48+
npm_config_arch: ia32
49+
- os: windows-latest
50+
platform: win32
51+
arch: arm64
52+
npm_config_arch: arm
53+
- os: ubuntu-latest
54+
platform: linux
55+
arch: x64
56+
npm_config_arch: x64
57+
- os: ubuntu-latest
58+
platform: linux
59+
arch: arm64
60+
npm_config_arch: arm64
61+
- os: ubuntu-latest
62+
platform: linux
63+
arch: armhf
64+
npm_config_arch: arm
65+
- os: ubuntu-latest
66+
platform: alpine
67+
arch: x64
68+
npm_config_arch: x64
69+
- os: macos-latest
70+
platform: darwin
71+
arch: x64
72+
npm_config_arch: x64
73+
- os: macos-latest
74+
platform: darwin
75+
arch: arm64
76+
npm_config_arch: arm64
77+
runs-on: ${{ matrix.os }}
78+
needs: lint
79+
env:
80+
npm_config_arch: ${{ matrix.npm_config_arch }}
81+
steps:
82+
- uses: actions/checkout@v2
83+
with:
84+
ref: ${{ github.event.pull_request.head.sha }}
85+
- name: Use Node.js
86+
uses: actions/setup-node@v2
87+
with:
88+
node-version: 16.x
89+
cache: 'npm'
90+
91+
- name: 'Installing Dependencies'
92+
run: npm ci
93+
3794
- name: 'Building'
38-
run: ./build.sh "${{ secrets.OAUTHCLIENTID }}" "${{ secrets.OAUTHCLIENTSECRET }}"
39-
- name: 'Preparing VSCE'
40-
run: npm i -g vsce
95+
run: npm run package -- --env CLIENTID=${{ secrets.OAUTHCLIENTID }} --env CLIENTSECRET=${{ secrets.OAUTHCLIENTSECRET }} && npm run ui:package
96+
4197
- name: 'Versioning'
4298
id: version
99+
shell: bash
43100
run: echo "VERSION=1.0.0-beta.$(date +%s)" >> $GITHUB_OUTPUT
101+
102+
- id: targeting
103+
name: Targeting
104+
shell: pwsh
105+
run: echo "target=${{ matrix.platform }}-${{ matrix.arch }}" >> $env:GITHUB_OUTPUT
106+
44107
- name: 'Packaging'
45108
id: packaging
46109
run: |
47-
vsce package --pre-release --no-update-package-json --no-git-tag-version ${{ steps.version.outputs.VERSION }} && \
48-
echo "PKG_NAME=vscode-cnb-${{ steps.version.outputs.VERSION }}.vsix" >> $GITHUB_OUTPUT
49-
- name: Uploading the Package
50-
uses: actions/upload-artifact@v3
110+
npx vsce package --pre-release --target ${{ steps.targeting.outputs.target }} --no-update-package-json --no-git-tag-version ${{ steps.version.outputs.VERSION }}
111+
- uses: actions/upload-artifact@v2
51112
with:
52-
name: ${{ steps.packaging.outputs.PKG_NAME }}
53-
path: ./${{ steps.packaging.outputs.PKG_NAME }}
113+
name: ${{ steps.targeting.outputs.target }}
114+
path: '*.vsix'

.github/workflows/marketplace-publish.yml

Lines changed: 70 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,83 @@ env:
1313

1414
jobs:
1515
build:
16-
runs-on: ubuntu-latest
17-
1816
strategy:
1917
matrix:
20-
node-version: [16.x]
21-
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
18+
include:
19+
- os: windows-latest
20+
platform: win32
21+
arch: x64
22+
npm_config_arch: x64
23+
- os: windows-latest
24+
platform: win32
25+
arch: ia32
26+
npm_config_arch: ia32
27+
- os: windows-latest
28+
platform: win32
29+
arch: arm64
30+
npm_config_arch: arm
31+
- os: ubuntu-latest
32+
platform: linux
33+
arch: x64
34+
npm_config_arch: x64
35+
- os: ubuntu-latest
36+
platform: linux
37+
arch: arm64
38+
npm_config_arch: arm64
39+
- os: ubuntu-latest
40+
platform: linux
41+
arch: armhf
42+
npm_config_arch: arm
43+
- os: ubuntu-latest
44+
platform: alpine
45+
arch: x64
46+
npm_config_arch: x64
47+
- os: macos-latest
48+
platform: darwin
49+
arch: x64
50+
npm_config_arch: x64
51+
- os: macos-latest
52+
platform: darwin
53+
arch: arm64
54+
npm_config_arch: arm64
55+
runs-on: ${{ matrix.os }}
2256
steps:
2357
- uses: actions/checkout@v2
24-
- name: Use Node.js ${{ matrix.node-version }}
58+
59+
- name: Use Node.js
2560
uses: actions/setup-node@v2
2661
with:
27-
node-version: ${{ matrix.node-version }}
62+
node-version: 16.x
2863
cache: 'npm'
29-
- name: 'Versioning'
30-
id: version
31-
run: echo "VERSION=${{ github.ref_name }}" | sed 's/v//' >> $GITHUB_OUTPUT
64+
3265
- name: 'Installing Dependencies'
3366
run: npm ci
67+
3468
- name: 'Building'
35-
run: ./build.sh "${{ secrets.OAUTHCLIENTID }}" "${{ secrets.OAUTHCLIENTSECRET }}"
36-
- name: 'Preparing VSCE'
37-
run: npm i -g vsce
38-
- name: 'Publishing'
39-
run: vsce publish --no-git-tag-version --no-update-package-json -p ${{ secrets.VSCETOKEN }} ${{ steps.version.outputs.VERSION }}
69+
run: npm run package -- --env CLIENTID=${{ secrets.OAUTHCLIENTID }} --env CLIENTSECRET=${{ secrets.OAUTHCLIENTSECRET }} && npm run ui:package
70+
71+
- name: 'Versioning'
72+
id: version
73+
shell: bash
74+
run: echo "VERSION=${{ github.ref_name }}" | sed 's/v//' >> $GITHUB_OUTPUT
75+
76+
- id: targeting
77+
name: Targeting
78+
shell: pwsh
79+
run: echo "target=${{ matrix.platform }}-${{ matrix.arch }}" >> $env:GITHUB_OUTPUT
80+
81+
- name: 'Packaging'
82+
run: npx vsce package --target ${{ steps.targeting.outputs.target }} --no-git-tag-version --no-update-package-json ${{ steps.version.outputs.VERSION }}
83+
84+
- name: 'Uploading'
85+
uses: actions/upload-artifact@v2
86+
with:
87+
name: ${{ steps.targeting.outputs.target }}
88+
path: '*.vsix'
89+
90+
publish:
91+
runs-on: ubuntu-latest
92+
needs: build
93+
steps:
94+
- uses: actions/download-artifact@v2
95+
- run: npx vsce publish --packagePath $(find . -iname *.vsix) -p ${{ secrets.VSCETOKEN }}

0 commit comments

Comments
 (0)