forked from hata6502/editorjs-layout
-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
7e11438
commit 65661a3
Showing
3 changed files
with
82 additions
and
39 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,76 @@ | ||
name: Create a new release and a publish to GitHub Package Registry | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- 'main' | ||
|
||
jobs: | ||
release: | ||
name: Create a new release | ||
runs-on: ubuntu-latest | ||
outputs: | ||
tag: "${{ steps.version.outputs.tag }}" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: 'Get Previous tag' | ||
id: previoustag | ||
uses: "WyriHaximus/github-action-get-previous-tag@v1" | ||
env: | ||
GITHUB_TOKEN: "${{ secrets.GH_PAT }}" | ||
- name: 'Get next minor version' | ||
id: semvers | ||
uses: "WyriHaximus/github-action-next-semvers@v1" | ||
with: | ||
version: ${{ steps.previoustag.outputs.tag }} | ||
- name: 'Set the next version to use' | ||
id: version | ||
run: | | ||
if [[ "${{ steps.semvers.outputs.patch }}" == *.9 ]] | ||
then | ||
echo "tag=${{ steps.semvers.outputs.minor }}" >> $GITHUB_OUTPUT | ||
else | ||
echo "tag=${{ steps.semvers.outputs.patch }}" >> $GITHUB_OUTPUT | ||
fi | ||
- name: 'Create a tag and release' | ||
uses: "softprops/action-gh-release@v1" | ||
env: | ||
GITHUB_TOKEN: "${{ secrets.GH_PAT }}" | ||
with: | ||
tag_name: "${{ steps.version.outputs.tag }}" | ||
|
||
build: | ||
needs: release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
- run: npm ci | ||
- run: npm test | ||
|
||
publish-gpr: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
registry-url: https://npm.pkg.github.com/ | ||
- run: npm ci | ||
- run: npm version "${{ release.steps.version.outputs.tag }}" -m "Release ${{ release.steps.version.outputs.tag }} 📣" | ||
- name: Authenticate with the GitHub Package Registry | ||
run: echo "//npm.pkg.github.com:_authToken=${{ secrets.GITHUB_TOKEN }}" > ~/.npmrc | ||
|
||
- run: npm publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} |
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