Skip to content

Commit

Permalink
Use npm version command (#317)
Browse files Browse the repository at this point in the history
  • Loading branch information
MiguelRipoll23 authored Mar 3, 2024
1 parent 6f88189 commit bda6002
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 12 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/bump-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,20 @@ jobs:
- name: Checkout branch
uses: actions/checkout@v4

- name: Cretate tag name
- name: Setup node
uses: actions/[email protected]

- name: Create tag name
uses: ./
id: create-tag-name
with:
channel: ${{ inputs.channel }}

- name: Update version
uses: reedyuk/[email protected]
with:
version: ${{ steps.create-tag-name.outputs.tag-name }}
run: |
npm version --no-git-tag-version ${{ env.TAG_NAME }}
env:
TAG_NAME: ${{ steps.create-tag-name.outputs.tag-name }}

- name: Create pull request
uses: peter-evans/create-pull-request@v6
Expand Down
23 changes: 15 additions & 8 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,30 @@ jobs:
create-tag:
name: Create tag
runs-on: ubuntu-latest

if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'new-release')

outputs:
tag-name: ${{ steps.prepare-tag.outputs.tag-name }}
tag-name: ${{ steps.get-tag-name.outputs.tag-name }}

steps:
- name: Parse tag
id: prepare-tag
- name: Checkout branch
uses: actions/checkout@v4

- name: Get tag name
id: get-tag-name
run: |
branch_name="${{ github.event.pull_request.head.ref }}"
tag_name=$(echo $branch_name | sed 's/version\///')
echo "tag-name=$tag_name" >> $GITHUB_OUTPUT
- name: Checkout branch
uses: actions/checkout@v4

- name: Create tag
run: |
git tag "${{ steps.prepare-tag.outputs.tag-name }}"
git tag "${{ env.TAG_NAME }}"
env:
TAG_NAME: ${{ steps.get-tag-name.outputs.tag-name }}

- name: Push tag to origin
run: git push origin "${{ steps.prepare-tag.outputs.tag-name }}"
run: git push origin "${{ env.TAG_NAME }}"
env:
TAG_NAME: ${{ steps.get-tag-name.outputs.tag-name }}

0 comments on commit bda6002

Please sign in to comment.