Skip to content

Commit

Permalink
ci: improve pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
Codeneos committed May 9, 2024
1 parent 4c3f481 commit 04d7998
Showing 1 changed file with 14 additions and 18 deletions.
32 changes: 14 additions & 18 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,26 @@
# Use the latest 2.1 version of CircleCI pipeline process engine.
# Use the latest 2.1 version of CircleCI pipeline process engine.
# See: https://circleci.com/docs/2.0/configuration-reference
version: 2.1

orbs:
sonarcloud: sonarsource/sonarcloud@2.0.0

commands:
commands:
checkout_install:
steps:
- checkout
- get_version
- run:
- checkout
- run:
name: Install package manager
command: corepack enable && corepack install
- restore_cache:
keys:
keys:
- pnpm-store-{{ checksum "pnpm-lock.yaml" }}
- run: pnpm config set store-dir ~/.pnpm-store
- run:
name: Install deps
command: |
sudo apt update
sudo apt-get install -y libsecret-1-dev
- run: pnpm --version
- run: pnpm install --frozen-lockfile
- save_cache:
key: pnpm-store-{{ checksum "pnpm-lock.yaml" }}
Expand Down Expand Up @@ -50,9 +48,10 @@ commands:

pack_extension:
steps:
- get_version
- run:
name: "Pack extension"
command: pnpm pack-extension $PRERELEASE
command: pnpm pack-extension ${PRERELEASE}
- persist_to_workspace:
root: .
paths: [ "packages/vscode-extension/*.vsix" ]
Expand All @@ -66,16 +65,15 @@ commands:
command: |
VERSION=$(node -p "require('./lerna.json').version")
[[ $VERSION =~ "-" ]] && export PRERELEASE="--pre-release"
echo ${PRERELEASE}
release_notes:
steps:
- run:
- run:
name: Get Release Notes
command: |
node -e "fs.writeFileSync('./release-notes.md', fs.readFileSync('./CHANGELOG.md').toString().match(/(##? \[(.*?))## \[/s)[1])"
NOTES=$(cat ./release-notes.md)
echo ${NOTES}
cat ./release-notes.md
- store_artifacts:
path: release-notes.md

Expand All @@ -85,16 +83,14 @@ jobs:
- image: cimg/node:18.19-browsers
steps:
- checkout_install
- get_version
- release_notes
- build
- codequality
- test
package:
docker:
- image: cimg/node:18.19-browsers
steps:
- checkout_install
- get_version
- pack_extension
publish-vsc-extension:
docker:
Expand All @@ -107,7 +103,7 @@ jobs:
- run:
name: "Publish extension on VSCode Marketplace"
command: |
pnpx vsce publish -p "$VSCE_TOKEN" $PRERELEASE --packagePath "./artifacts/packages/vscode-extension/vlocode-${VERSION}.vsix"
pnpx vsce publish -p "$VSCE_TOKEN" ${PRERELEASE} --packagePath "./artifacts/packages/vscode-extension/vlocode-${VERSION}.vsix"
publish-npm-packages:
docker:
- image: cimg/node:18.19-browsers
Expand All @@ -120,7 +116,7 @@ jobs:
docker:
- image: cibuilds/github:0.13
steps:
- checkout
- checkout
- get_version
- release_notes
- attach_workspace:
Expand All @@ -131,8 +127,8 @@ jobs:
VERSION=$(cat ./artifacts/.version)
ghr ${PRERELEASE} \
-t ${GITHUB_TOKEN} \
-b "${NOTES}" \
-n "Version ${VERSION}" \
-b "${NOTES}" \
-n "Version ${VERSION}" \
-u ${CIRCLE_PROJECT_USERNAME} \
-r ${CIRCLE_PROJECT_REPONAME} \
-c ${CIRCLE_SHA1} \
Expand Down

0 comments on commit 04d7998

Please sign in to comment.