Compare commits
12
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1b6fc41887 | ||
|
|
c6cde72b37 | ||
|
|
d47636092a | ||
|
|
e292f8ca51 | ||
|
|
8f4080074b | ||
|
|
b04e5db100 | ||
|
|
2795997f4c | ||
|
|
8bc0c5636e | ||
|
|
58bf3b35cc | ||
|
|
124ee84d1f | ||
|
|
9f4cb5f1da | ||
|
|
fe72328fef |
@@ -1,13 +1,18 @@
|
|||||||
name: Create release PR
|
name: Create release PR
|
||||||
|
|
||||||
run-name: Create release PR for v${{ github.event.inputs.version }}
|
run-name: Create release PR for new ${{ github.event.inputs.version }} version
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
version:
|
version:
|
||||||
required: true
|
required: true
|
||||||
description: "Version to bump `package.json` to (format: x.y.z)"
|
type: choice
|
||||||
|
description: "What type of release is this"
|
||||||
|
options:
|
||||||
|
- "major"
|
||||||
|
- "minor"
|
||||||
|
- "patch"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
create-release-pr:
|
create-release-pr:
|
||||||
@@ -31,21 +36,25 @@ jobs:
|
|||||||
git config --global user.email "[email protected]"
|
git config --global user.email "[email protected]"
|
||||||
git config --global user.name "GitHub Actions"
|
git config --global user.name "GitHub Actions"
|
||||||
|
|
||||||
git checkout -b release/${{ inputs.version }}
|
NEW_VERSION=$(./script/workflows/increment-version.sh ${{ inputs.version }})
|
||||||
|
|
||||||
npx lerna version ${{ inputs.version }} --yes --no-push --no-git-tag-version --force-publish
|
git checkout -b release/$NEW_VERSION
|
||||||
|
|
||||||
|
npx lerna version $NEW_VERSION --yes --no-push --no-git-tag-version --force-publish
|
||||||
|
|
||||||
git add **/package.json package-lock.json lerna.json
|
git add **/package.json package-lock.json lerna.json
|
||||||
git commit -m "Release extension version ${{ inputs.version }}"
|
git commit -m "Release extension version $NEW_VERSION"
|
||||||
|
|
||||||
git push --set-upstream origin release/${{ inputs.version }}
|
git push --set-upstream origin release/$NEW_VERSION
|
||||||
|
|
||||||
|
echo "new_version=$NEW_VERSION" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Create PR
|
- name: Create PR
|
||||||
run: |
|
run: |
|
||||||
gh pr create \
|
gh pr create \
|
||||||
--title "Release version ${{ inputs.version }}" \
|
--title "Release version ${{ env.new_version }}" \
|
||||||
--body "Release version ${{ inputs.version }}" \
|
--body "Release version ${{ env.new_version }}" \
|
||||||
--base main \
|
--base main \
|
||||||
--head release/${{ inputs.version }}
|
--head release/${{ env.new_version }}
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|||||||
@@ -179,6 +179,7 @@ export class Lexer {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case "'":
|
case "'":
|
||||||
|
case '"':
|
||||||
this.consumeString();
|
this.consumeString();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -299,8 +300,13 @@ export class Lexer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private consumeString() {
|
private consumeString() {
|
||||||
while ((this.peek() !== "'" || this.peekNext() === "'") && !this.atEnd()) {
|
// TODO: Should I make these consume double quotes as well?
|
||||||
|
const isSingleQuote = this.peek() !== "'" || this.peekNext() === "'";
|
||||||
|
const isDoubleQuote = this.peek() !== '"' || this.peekNext() === '"';
|
||||||
|
|
||||||
|
while ((isSingleQuote || isDoubleQuote) && !this.atEnd()) {
|
||||||
if (this.peek() === "\n") this.line++;
|
if (this.peek() === "\n") this.line++;
|
||||||
|
// TODO: Should I also add this for double quotes?
|
||||||
if (this.peek() === "'" && this.peekNext() === "'") {
|
if (this.peek() === "'" && this.peekNext() === "'") {
|
||||||
// Escaped "'", consume
|
// Escaped "'", consume
|
||||||
this.next();
|
this.next();
|
||||||
|
|||||||
Executable
+24
@@ -0,0 +1,24 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
VERSION=$(cat lerna.json | jq -r '.version')
|
||||||
|
|
||||||
|
MAJOR=$(echo $VERSION | cut -d. -f1)
|
||||||
|
MINOR=$(echo $VERSION | cut -d. -f2)
|
||||||
|
PATCH=$(echo $VERSION | cut -d. -f3)
|
||||||
|
|
||||||
|
if [ "$1" == "major" ]; then
|
||||||
|
MAJOR=$((MAJOR+1))
|
||||||
|
MINOR=0
|
||||||
|
PATCH=0
|
||||||
|
elif [ "$1" == "minor" ]; then
|
||||||
|
MINOR=$((MINOR+1))
|
||||||
|
PATCH=0
|
||||||
|
elif [ "$1" == "patch" ]; then
|
||||||
|
PATCH=$((PATCH+1))
|
||||||
|
else
|
||||||
|
echo "Invalid version type. Use 'major', 'minor' or 'patch'"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
NEW_VERSION="$MAJOR.$MINOR.$PATCH"
|
||||||
|
echo $NEW_VERSION
|
||||||
Reference in New Issue
Block a user