Skip to content

Commit 989f8ce

Browse files
Migration to Shared CI (#638)
2 parents 8f3e3ee + d5323cd commit 989f8ce

File tree

5 files changed

+75
-52
lines changed

5 files changed

+75
-52
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ on:
33
push:
44
branches:
55
- master
6-
tags:
7-
- v*
86
pull_request:
97

108
jobs:
@@ -27,52 +25,4 @@ jobs:
2725
- run: npm run test
2826
# disable coverage for now (because coveralls is down right now)
2927
#- run: npm run publish-coverage
30-
- run: npm run package
31-
release:
32-
#only run this task if a tag starting with 'v' was used to trigger this (i.e. a tagged release)
33-
if: startsWith(github.ref, 'refs/tags/v')
34-
needs: ci
35-
runs-on: ubuntu-latest
36-
#the ovsx publish never quits (but the upload succeeds), so kill the build if we've taken more than 10 minutes
37-
timeout-minutes: 10
38-
env:
39-
VSCE_TOKEN: ${{ secrets.VSCE_TOKEN }}
40-
OPEN_VSX_TOKEN: ${{ secrets.OPEN_VSX_TOKEN }}
41-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42-
steps:
43-
- uses: actions/checkout@master
44-
- uses: actions/setup-node@master
45-
with:
46-
node-version: "18.18.2"
47-
#build package
48-
- run: npm ci
49-
- run: npm run build
50-
- run: npm run package
51-
52-
#create GitHub release
53-
- name: Create GitHub Release
54-
id: create_release
55-
uses: actions/create-release@latest
56-
with:
57-
tag_name: ${{ github.ref }}
58-
release_name: ${{ github.ref }}
59-
draft: false
60-
prerelease: false #contains(github.ref, '-beta.') == true
61-
62-
#upload package to GitHub release
63-
- name: Upload GitHub Release Assets
64-
uses: alexellis/upload-assets@0.2.3
65-
with:
66-
asset_paths: '["*.vsix"]'
67-
68-
#publish vsix to Visual Studio extension store
69-
- name: Publish to VSCode extension store
70-
#exclude beta release tags
71-
if: contains(github.ref, '-beta.') == false
72-
run: npx vsce publish -p ${{env.VSCE_TOKEN}}
73-
74-
#pubish to OpenVSX
75-
- name: Publish to OpenVSX registry
76-
#exclude beta release tags
77-
if: contains(github.ref, '-beta.') == false
78-
run: npx ovsx publish -p ${{env.OPEN_VSX_TOKEN}} --debug
28+
- run: npm run create-package
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Initialize Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
branch:
7+
type: string
8+
description: "The branch to create the release from"
9+
default: "master"
10+
required: true
11+
releaseType:
12+
type: choice
13+
description: "The type of release: major, minor, or patch"
14+
required: true
15+
default: "patch"
16+
options:
17+
- major
18+
- minor
19+
- patch
20+
installDependencies:
21+
type: boolean
22+
description: "Install latest RokuCommunity dependencies"
23+
required: true
24+
default: true
25+
26+
jobs:
27+
run:
28+
uses: rokucommunity/workflows/.github/workflows/initialize-release.yml@master
29+
with:
30+
branch: ${{ github.event.inputs.branch }}
31+
releaseType: ${{ github.event.inputs.releaseType }}
32+
installDependencies: ${{ github.event.inputs.installDependencies }}
33+
secrets: inherit
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Make Release Artifacts
2+
3+
on:
4+
pull_request:
5+
types:
6+
- reopened
7+
- opened
8+
- synchronize
9+
paths:
10+
- 'package.json'
11+
- 'package-lock.json'
12+
13+
jobs:
14+
run:
15+
if: startsWith( github.head_ref, 'release/')
16+
uses: rokucommunity/workflows/.github/workflows/make-release-artifacts.yml@master
17+
with:
18+
branch: ${{ github.event.pull_request.head.ref }}
19+
node-version: "18.18.2"
20+
artifact-paths: "*.vsix"
21+
secrets: inherit
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Publish Release
2+
3+
on:
4+
pull_request:
5+
types:
6+
- closed
7+
paths:
8+
- 'package.json'
9+
- 'package-lock.json'
10+
11+
jobs:
12+
run:
13+
if: startsWith( github.head_ref, 'release/') && (github.event.pull_request.merged == true)
14+
uses: rokucommunity/workflows/.github/workflows/publish-release.yml@master
15+
with:
16+
release-type: "npm" # "vsce"
17+
ref: ${{ github.event.pull_request.merge_commit_sha }}
18+
secrets: inherit

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@
3939
"test:nocover": "mocha",
4040
"publish-coverage": "nyc report --reporter=text-lcov | coveralls",
4141
"check-extraneous": "npm list --production --parseable --depth=99999",
42-
"package": "vsce package",
42+
"create-package": "vsce package",
43+
"package": "npm run build && vsce package",
4344
"package-local": "node scripts/package-local.js",
4445
"publish": "vsce publish",
4546
"clean": "rimraf dist",

0 commit comments

Comments
 (0)