Skip to content

Commit 045410a

Browse files
committed
Remove badge
1 parent 78e4f69 commit 045410a

File tree

1 file changed

+168
-167
lines changed

1 file changed

+168
-167
lines changed

.github/workflows/ci.yml

Lines changed: 168 additions & 167 deletions
Original file line numberDiff line numberDiff line change
@@ -1,167 +1,168 @@
1-
name: CI
2-
3-
on:
4-
push:
5-
branches:
6-
- main
7-
pull_request:
8-
branches:
9-
- main
10-
workflow_dispatch:
11-
merge_group:
12-
release:
13-
types: [published]
14-
15-
jobs:
16-
build:
17-
name: Build and test
18-
runs-on: [ubuntu-latest]
19-
steps:
20-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
21-
with:
22-
fetch-depth: 0
23-
submodules: true
24-
25-
- uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
26-
with:
27-
node-version-file: package.json
28-
registry-url: https://npm.pkg.github.com
29-
always-auth: true
30-
cache: 'yarn'
31-
32-
- name: Set version
33-
if: github.repository_owner == 'Open-CMSIS-Pack'
34-
run: |
35-
case ${{ github.event_name }} in
36-
release)
37-
TAG="${{ github.event.release.tag_name }}"
38-
yarn version --no-git-tag-version --new-version "${TAG#v}"
39-
;;
40-
pull_request)
41-
DESCRIBE=$(git describe --tags | grep -Eo 'v[0-9]+\.[0-9]+\.[0-9]+')
42-
QUALIFIER=$(git describe --tags | grep -Eo '\-g[0-9a-f]+$')
43-
yarn version -s --no-git-tag-version --new-version "${DESCRIBE#v}"
44-
yarn version --no-git-tag-version --prepatch --preid "pr${{ github.event.number }}${QUALIFIER}"
45-
;;
46-
*)
47-
DESCRIBE=$(git describe --tags | grep -Eo 'v[0-9]+\.[0-9]+\.[0-9]+')
48-
QUALIFIER=$(git describe --tags | grep -Eo '[0-9]+\-g[0-9a-f]+$')
49-
yarn version -s --no-git-tag-version --new-version "${DESCRIBE#v}"
50-
yarn version --no-git-tag-version --prepatch --preid "${{ github.ref_name }}${QUALIFIER}"
51-
;;
52-
esac
53-
VERSION="$(jq -r ".version" < package.json)"
54-
sed -i "s/## Unreleased/## ${VERSION}/" CHANGELOG.md
55-
echo "Version is ${VERSION}"
56-
57-
- name: Remove Badges for dist
58-
run: |
59-
sed -i "/https:\/\/codeclimate\.com\/github\/Open\-CMSIS\-Pack\/vscode\-cmsis\-debugger/d" README.md
60-
61-
- name: Build
62-
env:
63-
GITHUB_TOKEN: ${{github.token}}
64-
run: yarn --frozen-lockfile --prefer-offline
65-
66-
- name: Test
67-
run: yarn test
68-
69-
- name: Upload dist
70-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
71-
with:
72-
name: dist
73-
path: |
74-
./README.md
75-
./CHANGELOG.md
76-
./package.json
77-
./dist
78-
retention-days: 1
79-
80-
- name: Commit changelog
81-
if: false && github.event_name == 'release'
82-
run: |
83-
sed -i '3i ## Unreleased\n' CHANGELOG.md
84-
git checkout main
85-
git config user.name github-actions
86-
git config user.email [email protected]
87-
git add CHANGELOG.md
88-
git commit -m "Update CHANGELOG.md after release [skip ci]"
89-
git push
90-
91-
- name: Publish coverage report to Code Climate
92-
if: github.repository_owner == 'Open-CMSIS-Pack'
93-
uses: paambaati/codeclimate-action@f429536ee076d758a24705203199548125a28ca7 # v9.0.0
94-
env:
95-
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}
96-
with:
97-
debug: true
98-
coverageLocations: coverage/lcov.info:lcov
99-
100-
package:
101-
name: Package
102-
runs-on: [ubuntu-latest]
103-
needs: build
104-
strategy:
105-
fail-fast: true
106-
matrix:
107-
target:
108-
- win32-x64
109-
- linux-x64
110-
- linux-arm64
111-
- darwin-arm64
112-
steps:
113-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
114-
115-
- uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
116-
with:
117-
node-version-file: package.json
118-
registry-url: https://npm.pkg.github.com
119-
always-auth: true
120-
cache: 'yarn'
121-
122-
- name: Download dist
123-
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
124-
with:
125-
name: dist
126-
path: .
127-
128-
- name: Cache tools
129-
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.6
130-
with:
131-
path: tools
132-
key: tools-${{ matrix.target }}-${{ github.head_ref || github.ref_name }}
133-
restore-keys: |
134-
tools-${{ matrix.target }}-${{ github.base_ref || 'main' }}
135-
tools-${{ matrix.target }}-
136-
137-
- name: Download tools
138-
run: |
139-
yarn --frozen-lockfile --ignore-scripts --prefer-offline
140-
yarn download-tools --target ${{ matrix.target }} --no-cache
141-
142-
- name: Create vsix package (pre-release)
143-
run: |
144-
yarn package --target ${{ matrix.target }} --pre-release
145-
146-
- name: Upload package
147-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
148-
with:
149-
name: vsix-package-${{ matrix.target }}
150-
path: ./*.vsix
151-
retention-days: 1
152-
153-
publish:
154-
name: Publish release
155-
runs-on: [ubuntu-latest]
156-
if: github.event_name == 'release'
157-
needs: package
158-
steps:
159-
- name: Download packages
160-
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
161-
with:
162-
pattern: vsix-package-*
163-
164-
- name: Attach packages
165-
uses: softprops/action-gh-release@da05d552573ad5aba039eaac05058a918a7bf631 # v2.2.2
166-
with:
167-
files: "**/*.vsix"
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
workflow_dispatch:
11+
merge_group:
12+
release:
13+
types: [published]
14+
15+
jobs:
16+
build:
17+
name: Build and test
18+
runs-on: [ubuntu-latest]
19+
steps:
20+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
21+
with:
22+
fetch-depth: 0
23+
submodules: true
24+
25+
- uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
26+
with:
27+
node-version-file: package.json
28+
registry-url: https://npm.pkg.github.com
29+
always-auth: true
30+
cache: 'yarn'
31+
32+
- name: Set version
33+
if: github.repository_owner == 'Open-CMSIS-Pack'
34+
run: |
35+
case ${{ github.event_name }} in
36+
release)
37+
TAG="${{ github.event.release.tag_name }}"
38+
yarn version --no-git-tag-version --new-version "${TAG#v}"
39+
;;
40+
pull_request)
41+
DESCRIBE=$(git describe --tags | grep -Eo 'v[0-9]+\.[0-9]+\.[0-9]+')
42+
QUALIFIER=$(git describe --tags | grep -Eo '\-g[0-9a-f]+$')
43+
yarn version -s --no-git-tag-version --new-version "${DESCRIBE#v}"
44+
yarn version --no-git-tag-version --prepatch --preid "pr${{ github.event.number }}${QUALIFIER}"
45+
;;
46+
*)
47+
DESCRIBE=$(git describe --tags | grep -Eo 'v[0-9]+\.[0-9]+\.[0-9]+')
48+
QUALIFIER=$(git describe --tags | grep -Eo '[0-9]+\-g[0-9a-f]+$')
49+
yarn version -s --no-git-tag-version --new-version "${DESCRIBE#v}"
50+
yarn version --no-git-tag-version --prepatch --preid "${{ github.ref_name }}${QUALIFIER}"
51+
;;
52+
esac
53+
VERSION="$(jq -r ".version" < package.json)"
54+
sed -i "s/## Unreleased/## ${VERSION}/" CHANGELOG.md
55+
echo "Version is ${VERSION}"
56+
57+
- name: Remove Badges for dist
58+
run: |
59+
sed -i "/https:\/\/codeclimate\.com\/github\/Open\-CMSIS\-Pack\/vscode\-cmsis\-debugger/d" README.md
60+
sed -i "/https:\/\/securityscorecards\.dev\/viewer/d" README.md
61+
62+
- name: Build
63+
env:
64+
GITHUB_TOKEN: ${{github.token}}
65+
run: yarn --frozen-lockfile --prefer-offline
66+
67+
- name: Test
68+
run: yarn test
69+
70+
- name: Upload dist
71+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
72+
with:
73+
name: dist
74+
path: |
75+
./README.md
76+
./CHANGELOG.md
77+
./package.json
78+
./dist
79+
retention-days: 1
80+
81+
- name: Commit changelog
82+
if: false && github.event_name == 'release'
83+
run: |
84+
sed -i '3i ## Unreleased\n' CHANGELOG.md
85+
git checkout main
86+
git config user.name github-actions
87+
git config user.email [email protected]
88+
git add CHANGELOG.md
89+
git commit -m "Update CHANGELOG.md after release [skip ci]"
90+
git push
91+
92+
- name: Publish coverage report to Code Climate
93+
if: github.repository_owner == 'Open-CMSIS-Pack'
94+
uses: paambaati/codeclimate-action@f429536ee076d758a24705203199548125a28ca7 # v9.0.0
95+
env:
96+
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}
97+
with:
98+
debug: true
99+
coverageLocations: coverage/lcov.info:lcov
100+
101+
package:
102+
name: Package
103+
runs-on: [ubuntu-latest]
104+
needs: build
105+
strategy:
106+
fail-fast: true
107+
matrix:
108+
target:
109+
- win32-x64
110+
- linux-x64
111+
- linux-arm64
112+
- darwin-arm64
113+
steps:
114+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
115+
116+
- uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
117+
with:
118+
node-version-file: package.json
119+
registry-url: https://npm.pkg.github.com
120+
always-auth: true
121+
cache: 'yarn'
122+
123+
- name: Download dist
124+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
125+
with:
126+
name: dist
127+
path: .
128+
129+
- name: Cache tools
130+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.6
131+
with:
132+
path: tools
133+
key: tools-${{ matrix.target }}-${{ github.head_ref || github.ref_name }}
134+
restore-keys: |
135+
tools-${{ matrix.target }}-${{ github.base_ref || 'main' }}
136+
tools-${{ matrix.target }}-
137+
138+
- name: Download tools
139+
run: |
140+
yarn --frozen-lockfile --ignore-scripts --prefer-offline
141+
yarn download-tools --target ${{ matrix.target }} --no-cache
142+
143+
- name: Create vsix package (pre-release)
144+
run: |
145+
yarn package --target ${{ matrix.target }} --pre-release
146+
147+
- name: Upload package
148+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
149+
with:
150+
name: vsix-package-${{ matrix.target }}
151+
path: ./*.vsix
152+
retention-days: 1
153+
154+
publish:
155+
name: Publish release
156+
runs-on: [ubuntu-latest]
157+
if: github.event_name == 'release'
158+
needs: package
159+
steps:
160+
- name: Download packages
161+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
162+
with:
163+
pattern: vsix-package-*
164+
165+
- name: Attach packages
166+
uses: softprops/action-gh-release@da05d552573ad5aba039eaac05058a918a7bf631 # v2.2.2
167+
with:
168+
files: "**/*.vsix"

0 commit comments

Comments
 (0)