Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate VSCode extension release to GH Action #2497

Merged
merged 7 commits into from
Nov 14, 2024

Conversation

yangwooseong
Copy link
Collaborator

@yangwooseong yangwooseong commented Nov 12, 2024

Self Checklist

  • I wrote a PR title in English and added an appropriate label to the PR.
  • I wrote the commit message in English and to follow the Conventional Commits specification.
  • I added the changeset about the changes that needed to be released. (or didn't have to)
  • I wrote or updated documentation related to the changes. (or didn't have to)
  • I wrote or updated tests related to the changes. (or didn't have to)
  • I tested the changes in various browsers. (or didn't have to)
    • Windows: Chrome, Edge, (Optional) Firefox
    • macOS: Chrome, Edge, Safari, (Optional) Firefox

Related Issue

Summary

  • bezier-vscode 배포를 release.yml 에 추가해서 changesets PR을 머지하면 자동으로 배포되도록 합니다.
  • 누락된 LICENSE 파일을 추가합니다. 이게 없으니 vsce publish실행시키면 그대로 진행하시곘습니까? [y/N] 을 물어보네요.

Details

  • VSCE_PAT: VSCode 퍼블리셔의 토큰입니다. 레포 시크릿에 추가헀습니다.
  • --no-dependencies: yarn 버전 이슈때문에 안넣어주면 에러가 뜹니다 (Support yarn v2 microsoft/vscode-vsce#517)
  • continue-on-error: changesets PR 에 VSCode 관련 변경 사항이 없을 경우에 현재 배포된 버전과 같은 버전으로 배포하게 되는데 이때 워닝이 아니라 에러를 뱉기 떄문에 true 로 했습니다.
  • https://github.com/channel-io/bezier-react/pull/2496/files 이 PR이 머지되면 0.3.0 으로 버전이 올라간채로 changesets PR이 만들어지기 때문에, 그 전에 0.2.0 배포하고나서 changesets PR을 머지해서 0.3.0을 배포하도록 해야할 것 같네요.

Breaking change? (Yes/No)

  • No

References

@yangwooseong yangwooseong added ci Issue or PR related to continuous integration bezier-vscode Issue or PR related to bezier-vscode labels Nov 12, 2024
@yangwooseong yangwooseong self-assigned this Nov 12, 2024
Copy link

changeset-bot bot commented Nov 12, 2024

⚠️ No Changeset found

Latest commit: 9f577e8

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

channeltalk bot commented Nov 12, 2024

Copy link

codecov bot commented Nov 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.28%. Comparing base (973d75d) to head (9f577e8).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2497   +/-   ##
=======================================
  Coverage   82.28%   82.28%           
=======================================
  Files         143      143           
  Lines        2981     2981           
  Branches      918      918           
=======================================
  Hits         2453     2453           
  Misses        497      497           
  Partials       31       31           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

package.json Outdated
@@ -19,6 +19,7 @@
"update-snapshot": "yarn workspace @channel.io/bezier-react update-snapshot",
"changeset": "changeset",
"postinstall": "husky install",
"publish-vscode": "yarn workspace bezier-vscode publish --no-dependencies",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

자주 실행하는 커맨드라 alias 용도로 편리하게 사용하기 위한게 아니라면(이 기준이 좀 애매하긴 하지만) 각 패키지 종속적인 커맨드는 해당 패키지에 위치해있는게 좋을 거 같아요

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

그렇네요! bezier-vscode 패키지의 커맨드를 직접 실행하도록 변경했습니다


- name: Release VSCode extension
continue-on-error: true
run: npm i -g vsce && yarn publish-vscode
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

질문) npx 는 사용할 수 없나요? 똑같으려나 싶기도...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

npx 로 하는게 의미가 정확하겠네요


- name: Release VSCode extension
continue-on-error: true
run: npm i -g vsce && yarn publish-vscode
Copy link
Contributor

@sungik-choi sungik-choi Nov 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
run: npm i -g vsce && yarn publish-vscode
run: npm i -g vsce && yarn workspace bezier-vscode publish

마이너 제안

@@ -42,6 +42,6 @@ jobs:

- name: Release VSCode extension
continue-on-error: true
run: npm i -g vsce && yarn publish-vscode
run: npx vsce && yarn publish-vscode
Copy link
Contributor

@sungik-choi sungik-choi Nov 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

npx 명령어 수행 시점에 vsce가 일회용으로 설치되기만 하고 명령어가 실행은 안되어서 실패할 거에요

https://github.com/knkgun/gitlab-vscode-extension/blob/a1b2a97db944e8718a9e8c874f335db4614e5761/.gitlab-ci.yml#L131

이런 식으로 처리하거나, 기존처럼 전역으로 설치해야겠네요
(번외로 npx 사용한다면 대신 yarn dlx 써도 될 거 같습니다. 차이는 거의 없는 거 같아요. 캐시를 활용하는 것도 아니라서)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아.. 그렇네요 깃헙에서 use case 찾는거 꿀팁이네요!

@@ -60,7 +60,7 @@
"typecheck": "tsc --noEmit",
"clean": "rm -rf dist",
"vscode:prepublish": "yarn build",
"publish": "vsce publish"
"publish": "vsce publish --no-dependencies"
Copy link
Contributor

@sungik-choi sungik-choi Nov 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yarn dlx vsce publish --no-dependencies

vsce 패키지를 사용한다는 점을 패키지 외부에서 몰라도 되어서 이런 식이 더 좋을 거 같아요

@yangwooseong yangwooseong merged commit 89f5ac5 into channel-io:main Nov 14, 2024
5 checks passed
@yangwooseong yangwooseong deleted the WEB-5349/vscode-publish-ci branch November 14, 2024 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bezier-vscode Issue or PR related to bezier-vscode ci Issue or PR related to continuous integration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants