Compare commits

...

12 Commits

Author SHA1 Message Date
Jonathan Tamsut 1b6fc41887 Merge branch 'main' into jtamsut/tokenize-double-quotes 2023-05-01 12:58:18 -07:00
Felipe Suero c6cde72b37 Merge pull request #32 from actions/major-minor-choices
Automate incrementing the version number
2023-05-01 10:32:20 -04:00
Felipe Suero d47636092a don't pin actions stuff 2023-05-01 10:15:24 -04:00
Felipe Suero e292f8ca51 pin all the things 2023-05-01 10:10:52 -04:00
Felipe Suero 8f4080074b pin dependencies 2023-05-01 10:05:19 -04:00
Felipe Suero b04e5db100 save files 2023-04-28 12:55:00 -04:00
Felipe Suero 2795997f4c minor fixes 2023-04-28 12:53:31 -04:00
Felipe Suero 8bc0c5636e draw from lerna 2023-04-27 10:28:01 -04:00
Felipe Suero 58bf3b35cc chmod 2023-04-27 10:25:40 -04:00
Felipe Suero 124ee84d1f Automate incrementing the version number 2023-04-27 10:23:36 -04:00
Jonathan Tamsut 9f4cb5f1da run formatter 2023-04-26 18:44:06 -07:00
Jonathan Tamsut fe72328fef token double quotes 2023-04-25 17:38:26 -07:00
3 changed files with 49 additions and 10 deletions
+18 -9
View File
@@ -1,13 +1,18 @@
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:
workflow_dispatch:
inputs:
version:
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:
create-release-pr:
@@ -31,21 +36,25 @@ jobs:
git config --global user.email "github-actions@github.com"
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 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
run: |
gh pr create \
--title "Release version ${{ inputs.version }}" \
--body "Release version ${{ inputs.version }}" \
--title "Release version ${{ env.new_version }}" \
--body "Release version ${{ env.new_version }}" \
--base main \
--head release/${{ inputs.version }}
--head release/${{ env.new_version }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+7 -1
View File
@@ -179,6 +179,7 @@ export class Lexer {
break;
case "'":
case '"':
this.consumeString();
break;
@@ -299,8 +300,13 @@ export class Lexer {
}
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++;
// TODO: Should I also add this for double quotes?
if (this.peek() === "'" && this.peekNext() === "'") {
// Escaped "'", consume
this.next();
+24
View File
@@ -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