-
Notifications
You must be signed in to change notification settings - Fork 2
127 lines (106 loc) · 4.14 KB
/
release.yaml
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
name: Release
on:
workflow_dispatch:
inputs:
branch:
description: Branch to release from
required: true
default: main
release-version:
description: Version being released (e.g. 7.8.9)
required: true
next-version:
description: Version after the release (e.g. 7.8.10-dev)
required: true
# pre-release:
# type: boolean
# description: Create a pre-release version
# required: true
# default: true
changelog:
type: boolean
description: I have updated the CHANGELOG.md file
required: true
default: false
debug:
type: boolean
description: Debug with tmate on failure
required: true
default: true
jobs:
test:
runs-on: ubuntu-latest
if: github.repository_owner == 'Apicurio'
steps:
- name: Check prerequisites
if: ${{ !inputs.changelog }}
run: |
exit 1
- name: Set up npm
uses: actions/setup-node@v4
with:
node-version: 18
- name: Set up vsce
run: |
npm install -g @vscode/vsce
- name: Set up ovsx
run: |
npm install -g ovsx
- name: Checkout
run: |
git init
git config user.name apicurio-ci
git config user.email [email protected]
git remote add origin "https://apicurio-ci:${{ secrets.ACCESS_TOKEN }}@github.com/Apicurio/apicurio-registry-vscode-plugin.git"
git fetch
git checkout --track "origin/${{ inputs.branch }}"
- name: Dependencies
run: |
npm install
- name: Compile
run: |
npm run compile
- name: Run Registry
run: |
echo "REGISTRY_CID=$(docker run -d -p 8080:8080 quay.io/apicurio/apicurio-registry-mem:2.5.x-snapshot)" >> "$GITHUB_ENV"
- name: Test
run: |
xvfb-run -a npm run test
- name: Clean test artifacts
run: |
rm *.vsix
- name: Stop Registry
run: |
docker stop "$REGISTRY_CID"
# - name: Configure pre-release
# if: ${{ inputs.pre-release }}
# run: |
# echo "PRE_RELEASE=--pre-release" >> "$GITHUB_ENV"
# - name: Configure release
# if: ${{ !inputs.pre-release }}
# run: |
# echo "PRE_RELEASE=" >> "$GITHUB_ENV"
- name: Package
run: |
vsce package -m "Update to release version ${{ inputs.release-version }}" "${{ inputs.release-version }}"
echo "VSIX_FILE=apicurio-registry-explorer-${{ inputs.release-version }}.vsix" >> "$GITHUB_ENV"
- name: Publish with vsce
run: |
vsce publish -i "$VSIX_FILE" -p "${{ secrets.VSCODE_MARKETPLACE_ACCESS_TOKEN }}"
- name: Publish with ovsx
run: |
ovsx publish -i "$VSIX_FILE" -p "${{ secrets.OVSX_REGISTRY_ACCESS_TOKEN }}"
- name: Next version
# if: ${{ !inputs.pre-release }}
run: |
npm version --no-git-tag-version ${{ inputs.next-version }}
git commit -m "Update to next development version ${{ inputs.next-version }}"
- name: Push
# if: ${{ !inputs.pre-release }}
run: |
git push origin "${{ inputs.branch }}"
git push origin "v${{ inputs.release-version }}"
# TODO: Create a GitHub release
- name: Setup tmate session
if: failure() && inputs.debug
uses: mxschmitt/action-tmate@v3