Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[{*.yml}]
[*.yml]
indent_style = space
indent_size = 2
end_of_line = lf
Expand Down
23 changes: 14 additions & 9 deletions .github/workflows/bump.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
name: Bump
permissions:
contents: write
on:
workflow_run:
workflows:
Expand All @@ -25,19 +27,22 @@ jobs:
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Bump alpha version
if: github.event.workflow_run.head_branch == 'master-4'
run: npm version prerelease --preid=alpha --no-git-tag-version
- name: Bump beta version
if: github.event.workflow_run.head_branch == 'master'
run: npm version prerelease --preid=beta --no-git-tag-version
- name: Bump minor version
if: github.event.workflow_run.head_branch != 'master' && github.event.workflow_run.head_branch != 'master-4'
run: npm version minor --no-git-tag-version
- name: Resolve bump command
id: bump-command
uses: actions/github-script@v7
with:
result-encoding: string
script: |
const ref = github.context.payload.workflow_run?.head_branch || process.env.GITHUB_REF_NAME || "";
const type = ref == "master" ? "beta" : ref == "master-4" ? "alpha" : "minor";
return `npm version ${type == "minor" ? "minor" : "prerelease"} ${type != "minor" ? "--preid=" + type : ""}`;
- name: Bump version
run: ${{ steps.bump-command.outputs.result }}
- name: Push bumped version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git add package.json package-lock.json
git commit -m "chore: bump version after publish"
git push origin HEAD
git push --tags
19 changes: 10 additions & 9 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@ jobs:
run: npm ci
- name: Build package
run: npm run build
- name: Publish beta
if: github.ref_name == 'master'
run: npm publish --access public --provenance --tag beta
- name: Publish alpha
if: github.ref_name == 'master-4'
run: npm publish --access public --provenance --tag alpha
- name: Publish latest
if: github.ref_name != 'master' && github.ref_name != 'master-4'
run: npm publish --access public --provenance --tag latest
- name: Resolve publish tag
id: publish-tag
uses: actions/github-script@v7
with:
result-encoding: string
script: |
const ref = process.env.GITHUB_REF_NAME;
return ref == "master" ? "beta" : ref == "master-4" ? "alpha" : "latest";
- name: Publish package
run: npm publish --access public --provenance --tag ${{ steps.publish-tag.outputs.result }}
Loading