Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
337576fbb9 |
@@ -1,18 +1,13 @@
|
|||||||
name: Create release PR
|
name: Create release PR
|
||||||
|
|
||||||
run-name: Create release PR for new ${{ github.event.inputs.version }} version
|
run-name: Create release PR for v${{ github.event.inputs.version }}
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
version:
|
version:
|
||||||
required: true
|
required: true
|
||||||
type: choice
|
description: "Version to bump `package.json` to (format: x.y.z)"
|
||||||
description: "What type of release is this"
|
|
||||||
options:
|
|
||||||
- "major"
|
|
||||||
- "minor"
|
|
||||||
- "patch"
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
create-release-pr:
|
create-release-pr:
|
||||||
@@ -36,25 +31,21 @@ 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"
|
||||||
|
|
||||||
NEW_VERSION=$(./script/workflows/increment-version.sh ${{ inputs.version }})
|
git checkout -b release/${{ inputs.version }}
|
||||||
|
|
||||||
git checkout -b release/$NEW_VERSION
|
npx lerna version ${{ inputs.version }} --yes --no-push --no-git-tag-version --force-publish
|
||||||
|
|
||||||
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 $NEW_VERSION"
|
git commit -m "Release extension version ${{ inputs.version }}"
|
||||||
|
|
||||||
git push --set-upstream origin release/$NEW_VERSION
|
git push --set-upstream origin release/${{ inputs.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 ${{ env.new_version }}" \
|
--title "Release version ${{ inputs.version }}" \
|
||||||
--body "Release version ${{ env.new_version }}" \
|
--body "Release version ${{ inputs.version }}" \
|
||||||
--base main \
|
--base main \
|
||||||
--head release/${{ env.new_version }}
|
--head release/${{ inputs.version }}
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
# actions/expressions
|
# actions/expressions
|
||||||
|
|
||||||
|
blah
|
||||||
|
|
||||||
`@actions/expressions` is a library to parse and evaluate GitHub Actions [expressions](https://docs.github.com/actions/learn-github-actions/expressions).
|
`@actions/expressions` is a library to parse and evaluate GitHub Actions [expressions](https://docs.github.com/actions/learn-github-actions/expressions).
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
@@ -92,4 +94,4 @@ npm run format-check
|
|||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
This project is licensed under the terms of the MIT open source license. Please refer to [MIT](../LICENSE) for the full terms.
|
This project is licensed under the terms of the MIT open source license. Please refer to [MIT](../LICENSE) for the full terms.
|
||||||
|
|||||||
@@ -179,7 +179,6 @@ export class Lexer {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case "'":
|
case "'":
|
||||||
case '"':
|
|
||||||
this.consumeString();
|
this.consumeString();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -300,13 +299,8 @@ export class Lexer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private consumeString() {
|
private consumeString() {
|
||||||
// TODO: Should I make these consume double quotes as well?
|
while ((this.peek() !== "'" || this.peekNext() === "'") && !this.atEnd()) {
|
||||||
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();
|
||||||
|
|||||||
@@ -1,24 +0,0 @@
|
|||||||
#!/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