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

build: release preview package when triggered via comment #4750

Merged
merged 51 commits into from
Feb 14, 2022

Conversation

ad1992
Copy link
Member

@ad1992 ad1992 commented Feb 8, 2022

@excalidraw/excalidraw-preview

The release version will be {pkg.version}-{commithash}-{pr number} and github bot will post the version in comment as well #4750 (comment)

As the issue_comment workflow only works in default branch (the workflow code gets triggered from master /main branch) hence tested it in my fork and it works fine ad1992#39
Note: In my fork, I have added my PAT hence the thumbs up reaction and comment post release is posted by me

@vercel
Copy link

vercel bot commented Feb 8, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployments, click below or on the icon next to each commit.

excalidraw – ./

🔍 Inspect: https://vercel.com/excalidraw/excalidraw/7xJY3fQB5Z7vM4yt4W64PViXEugd
✅ Preview: https://excalidraw-git-aakansha-preview-excalidraw.vercel.app

excalidraw-package-example – ./src/packages/excalidraw

🔍 Inspect: https://vercel.com/excalidraw/excalidraw-package-example/FnPvpSkQ6e45LHVTiWetN354dDTq
✅ Preview: https://excalidraw-package-example-git-aakansha-preview-excalidraw.vercel.app

- name: React to trigger comment
uses: peter-evans/create-or-update-comment@v1
with:
token: ${{ secrets.PUSH_TRANSLATIONS_COVERAGE_PAT }}
Copy link
Member Author

Choose a reason for hiding this comment

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

This I think we should rename to EXCALIBOT_GITHUB_TOKEN

Copy link
Member

Choose a reason for hiding this comment

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

is it even necessary? Shouldn't the default GITHUB_TOKEN work when within the same repo?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is intentional so that the reaction/comment is posted by excalibot and not github bot since we already have our bot which we are using for other things like translation, raising pull requests etc and in future also we can use it for more purposes + the commit is triggered by @excalibot trigger release

@excalidraw excalidraw deleted a comment from github-actions bot Feb 13, 2022
scripts/autorelease.js Outdated Show resolved Hide resolved
if (isPreview) {
// use pullNumber-commithash as the version for preview
const pullRequestNumber = process.argv.slice(3)[0];
pkg.version = `${pkg.version}-${pullRequestNumber}`;
Copy link
Member

@dwelle dwelle Feb 13, 2022

Choose a reason for hiding this comment

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

Is the stable pkg.version useful here?

I'd go with this format: pr-${pullRequestNumber}-${getShortCommitHash()} (adding the pr- prefix so it's clear what the first number is about)

Copy link
Member Author

Choose a reason for hiding this comment

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

I will check if adding pr prefix throws semver error, if it doesn't then will go ahead with pr.${pullRequestNumber}.${getShortCommitHash()} as it should be in semver format else publish will throw error

Copy link
Member Author

Choose a reason for hiding this comment

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

This is not possible since in semantic version format major.minor.patch , major, minor , patch needs to be non negative numbers and in the minor we can append string after -
in prerelease
https://github.com/ad1992/excalidraw/runs/5179631681?check_suite_focus=true

@ad1992 ad1992 changed the title build: autorelease preview on every commit during pull request build: release preview package when triggred via comment Feb 14, 2022
@ad1992 ad1992 changed the title build: release preview package when triggred via comment build: release preview package when triggered via comment Feb 14, 2022
@ad1992 ad1992 merged commit a608608 into master Feb 14, 2022
@ad1992 ad1992 deleted the aakansha-preview branch February 14, 2022 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants