forked from material-extensions/vscode-material-icon-theme
-
Notifications
You must be signed in to change notification settings - Fork 0
107 lines (92 loc) Β· 3.44 KB
/
release.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
name: π Β» release and publish
run-name: π Β» release and publish
on:
workflow_dispatch:
inputs:
versionChange:
type: choice
description: Select the version change
required: true
default: "minor"
options:
- major
- minor
- patch
permissions:
id-token: write
contents: read
attestations: write
jobs:
release:
runs-on: ubuntu-latest
env:
VERSION_CHANGE: ${{ github.event.inputs.versionChange }}
permissions:
contents: write
id-token: write
attestations: write
steps:
- name: Checkout ποΈ
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
with:
fetch-depth: 0
- name: Setup Platform π
uses: oven-sh/setup-bun@4bc047ad259df6fc24a6c9b0f9a0cb08cf17fbe5 # v2
with:
bun-version-file: ".bun-version"
- name: π¦ Install dependencies
run: |
bun install --frozen-lockfile
bun add -g npm
- name: π Update version
run: |
git status
git config --global user.name 'Lucas Colombo'
git config --global user.email '[email protected]'
git config --global push.followTags true
bun run build
npm version ${{ env.VERSION_CHANGE }} -m "release: π v%s"
- name: π οΈ Build
run: bunx @vscode/vsce package
- name: π Get metadata
run: |
VERSION=$(bun --print "(await import('./package.json')).version")
NAME=$(bun --print "(await import('./package.json')).name")
DISPLAY_NAME=$(bun --print "(await import('./package.json')).displayName")
echo VERSION=$VERSION >> $GITHUB_ENV
echo NAME=$NAME >> $GITHUB_ENV
echo DISPLAY_NAME=$DISPLAY_NAME >> $GITHUB_ENV
- name: Attest artifacts β
uses: actions/attest@2da0b136720d14f01f4dbeeafd1d5a4d76cbe21d # v1.4.0
# Read: https://docs.github.com/en/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds
with:
subject-path: '${{ env.NAME }}-${{ env.VERSION }}.vsix'
predicate-type: 'https://in-toto.io/attestation/release'
predicate: '{}'
- name: π Push tags
run: git push
- name: π Release ${{ env.VERSION }}
uses: softprops/action-gh-release@01570a1f39cb168c169c802c3bceb9e93fb10974 # v2.1.0
with:
files: ${{ env.NAME }}-${{ env.VERSION }}.vsix
tag_name: v${{ env.VERSION }}
name: ${{ env.DISPLAY_NAME }} v${{ env.VERSION }}
generate_release_notes: true
- name: π Publish to Open VSX Registry
uses: HaaLeo/publish-vscode-extension@28e2d3f5817fccf23c1f219eb0cecc903132d1a2 # v1.6.2
# disable for now
if: ${{ false }}
with:
pat: ${{ secrets.OPEN_VSX_TOKEN }}
extensionFile: ${{ env.NAME }}-${{ env.VERSION }}.vsix
- name: Publish to Visual Studio Marketplace π
uses: HaaLeo/publish-vscode-extension@28e2d3f5817fccf23c1f219eb0cecc903132d1a2 # v1.6.2
with:
pat: ${{ secrets.VS_MARKETPLACE_TOKEN }}
registryUrl: https://marketplace.visualstudio.com
extensionFile: ${{ env.NAME }}-${{ env.VERSION }}.vsix
- name: Publish to NPM Registry π
run: npm publish
if: ${{ false }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}