forked from QwikDev/qwik
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: qwik-city release (QwikDev#430)
- Loading branch information
1 parent
2d84d77
commit 0584e22
Showing
14 changed files
with
195 additions
and
62 deletions.
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
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,43 @@ | ||
name: Release Qwik City | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
disttag: | ||
description: 'Publish to NPM using this dist-tag. The version number will come from version found in package.json.' | ||
required: true | ||
type: choice | ||
default: 'dev' | ||
options: | ||
- dev | ||
- next | ||
- latest | ||
|
||
jobs: | ||
publish: | ||
name: Publish Qwik City | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16.x | ||
cache: 'yarn' | ||
registry-url: https://registry.npmjs.org/ | ||
|
||
- run: corepack enable | ||
|
||
- name: Install NPM Dependencies | ||
run: yarn install --immutable --network-timeout 300000 | ||
|
||
- name: Build Qwik City | ||
run: cd packages/qwik-city && yarn build | ||
|
||
- name: Test Qwik City | ||
run: cd packages/qwik-city && yarn test | ||
|
||
- name: Publish Qwik City | ||
run: cd packages/qwik-city && yarn node -r esbuild-register scripts/release.ts --set-dist-tag="${{ github.event.inputs.disttag }}" |
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
5 changes: 1 addition & 4 deletions
5
packages/qwik-city/scripts/build.mjs → packages/qwik-city/scripts/build.ts
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,42 @@ | ||
/* eslint-disable no-console */ | ||
import { checkExistingNpmVersion, releaseVersionPrompt } from '../../../scripts/release'; | ||
import { readPackageJson, writePackageJson } from '../../../scripts/package-json'; | ||
import { join } from 'path'; | ||
import { panic, run } from '../../../scripts/util'; | ||
import semver from 'semver'; | ||
|
||
async function prepareReleaseQwikCity() { | ||
const pkgRootDir = join(__dirname, '..'); | ||
const pkg = await readPackageJson(pkgRootDir); | ||
|
||
console.log(`⛴ preparing ${pkg.name} ${pkg.version} release`); | ||
|
||
const answers = await releaseVersionPrompt(pkg.name, pkg.version); | ||
if (!semver.valid(answers.version)) { | ||
panic(`Invalid version`); | ||
} | ||
|
||
pkg.version = answers.version; | ||
|
||
await checkExistingNpmVersion(pkg.name, pkg.version); | ||
|
||
await writePackageJson(pkgRootDir, pkg); | ||
|
||
// git add the changed package.json | ||
const gitAddArgs = ['add', join(pkgRootDir, 'package.json')]; | ||
await run('git', gitAddArgs); | ||
|
||
// git commit the changed package.json | ||
const commitMessage = `qwik-city ${pkg.version}`; | ||
const gitCommitArgs = ['commit', '--message', commitMessage]; | ||
await run('git', gitCommitArgs); | ||
|
||
console.log(``); | ||
console.log(`Next:`); | ||
console.log(` - Submit a PR to main with the package.json update`); | ||
console.log(` - Once merged, run the "Release Qwik City" workflow`); | ||
console.log(` - https://github.com/BuilderIO/qwik/actions/workflows/release-qwik-city.yml`); | ||
console.log(``); | ||
} | ||
|
||
prepareReleaseQwikCity(); |
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,21 @@ | ||
/* eslint-disable no-console */ | ||
import mri from 'mri'; | ||
import { join } from 'path'; | ||
import { run } from '../../../scripts/util'; | ||
import { readPackageJson } from '../../../scripts/package-json'; | ||
|
||
async function releaseQwikCity() { | ||
const args = mri(process.argv.slice(2)); | ||
|
||
const distTag = args['set-dist-tag']; | ||
|
||
const pkgRootDir = join(__dirname, '..'); | ||
const pkg = await readPackageJson(pkgRootDir); | ||
|
||
console.log(`🚢 publishing ${pkg.name} ${pkg.version}`); | ||
|
||
const npmPublishArgs = ['publish', '--tag', distTag, '--access', 'public']; | ||
await run('npm', npmPublishArgs, false, false, { cwd: pkgRootDir }); | ||
} | ||
|
||
releaseQwikCity(); |
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
Oops, something went wrong.