-
Notifications
You must be signed in to change notification settings - Fork 937
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
86 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: VSCode Plugin Deploy | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
release-type: | ||
description: "Release Type" | ||
type: choice | ||
default: "canary" | ||
required: true | ||
options: | ||
- canary | ||
- production | ||
|
||
jobs: | ||
deploy: | ||
name: Canary Deploy | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up node (16) | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16.x | ||
- name: Checkout current branch (with history) | ||
uses: actions/checkout@master | ||
- name: Install top level | ||
run: npm install | ||
- name: Bump version and package the plugin for Monospace | ||
run: | | ||
cd firebase-vscode | ||
npm install | ||
npm run pkg:monospace | ||
- name: Upload to GCS | ||
run: #TODO | ||
|
||
|
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,24 @@ | ||
const { writeFileSync } = require("fs"); | ||
const { execSync } = require("child_process"); | ||
const path = require("path"); | ||
const { argv } = require("yargs"); | ||
const semver = require("semver"); | ||
const pkg = require(path.join(__dirname, "../package.json")); | ||
|
||
const releaseType = argv['release-type']; | ||
|
||
const currentVersion = pkg.version; | ||
|
||
if (releaseType === 'canary') { | ||
const nextPatchVersion = semver.inc(currentVersion, 'patch'); | ||
const headSha = execSync('git rev-parse --short HEAD').toString().trim(); | ||
// Should we use sha or timestamp? Does sha read as always incrementing? | ||
// Pros: sha lets you trace back to the exact commit | ||
pkg.version = `${nextPatchVersion}-alpha.${headSha}`; | ||
|
||
writeFileSync( | ||
path.join(__dirname, "../package.json"), | ||
JSON.stringify(pkg, null, 2), | ||
{ encoding: "utf8" } | ||
); | ||
} |
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