-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
workflow: separate version bumping and publishing on release #6879
Merged
Merged
Changes from 8 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
e16a8cd
workflow: separate version bumping and publishing on release
antfu 68a2684
chore: update create-vite templates version
antfu cf54ab2
chore: inline changelog script
antfu 6591064
chore: update action
antfu 3024e56
chore: update version choices
antfu 6923bc9
chore: show commit diff on release
antfu 73dcf09
chore: update
antfu 586d378
chore: update
antfu 396cdbd
Update scripts/releaseUtils.ts
antfu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Publish Package | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10 | ||
- "plugin-*" # Push events to matching plugin-*, i.e. plugin-(vue|vue-jsx|react|legacy)@1.0.0 | ||
- "create-vite*" # # Push events to matching create-vite*, i.e. create-vite@1.0.0 | ||
|
||
jobs: | ||
publish: | ||
# prevents this action from running on forks | ||
if: github.repository == 'vitejs/vite' | ||
runs-on: ubuntu-latest | ||
environment: Release | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install pnpm | ||
uses: pnpm/action-setup@v2 | ||
with: | ||
version: 6 | ||
|
||
- name: Set node version to 16.x | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 16.x | ||
cache: "pnpm" | ||
|
||
- name: Install deps | ||
run: pnpm install | ||
|
||
- name: Publish package | ||
run: pnpm run ci-publish -- ${{ github.ref_name }} --dry | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { args, getPackageInfo, publishPackage, step } from './releaseUtils' | ||
|
||
async function main() { | ||
const tag = args._[0] | ||
|
||
if (!tag) { | ||
throw new Error('No tag specified') | ||
} | ||
|
||
let pkgName = 'vite' | ||
let version | ||
|
||
if (tag.includes('@')) [pkgName, version] = tag.split('@') | ||
else version = tag | ||
|
||
if (version.startsWith('v')) version = version.slice(1) | ||
|
||
const { currentVersion, pkgDir } = getPackageInfo(pkgName) | ||
if (currentVersion !== version) | ||
throw new Error( | ||
`Package version from tag "${version}" mismatches with current version "${currentVersion}"` | ||
) | ||
|
||
step('Publishing package...') | ||
await publishPackage(pkgDir, version.includes('beta') ? 'beta' : undefined) | ||
} | ||
|
||
main().catch((err) => { | ||
console.error(err) | ||
process.exit(1) | ||
}) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: remove the
--dry
flag