diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index eed635f..a1cfcad 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -34,16 +34,18 @@ jobs: - name: Pre-Publish run: npx nx run pre-publish - - name: Read version from package.json - id: get-version - run: echo "{version}={$(jq -r '.version' packages/core/package.json)}" >> $GITHUB_OUTPUT" + - name: get-npm-version + id: package-version + uses: martinbeentjes/npm-get-version-action@v1.3.1 + with: + path: packages/core - name: Commit release uses: EndBug/add-and-commit@v9 with: add: "['package-lock.json', 'CHANGELOG.md']" - message: ':bookmark: release: ${{ steps.get-version.outputs.version }}' - tag: 'v${{ steps.get-version.outputs.version }}' + message: ':bookmark: release: ${{ steps.package-version.outputs.current-version }}' + tag: 'v${{ steps.package-version.outputs.current-version }}' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -53,7 +55,7 @@ jobs: type: now from_branch: main target_branch: latest - message: ':bookmark: release: ${{ steps.get-version.outputs.version }}' + message: ':bookmark: release: ${{ steps.package-version.outputs.current-version }}' github_token: ${{ secrets.GITHUB_TOKEN }} - name: Publish diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml index be741e5..22b63c9 100644 --- a/.github/workflows/snapshot.yml +++ b/.github/workflows/snapshot.yml @@ -43,11 +43,15 @@ jobs: run: echo "${{steps.set-version.outputs.version}}" - name: Create comment - uses: peter-evans/create-or-update-comment@v3 + uses: peter-evans/create-or-update-comment@v4 with: comment-id: ${{ github.event.comment.id }} + edit-mode: replace body: | - 🚚 Snapshot `${{ steps.set-version.outputs.version }}` in progress... [Action](${{ steps.action-url.outputs.url }}) + ## 🚚 Snapshot + + `${{ steps.set-version.outputs.version }}` in progress... + [Action](${{ steps.action-url.outputs.url }}) - uses: ./.github/workflows/actions/release-setup with: @@ -55,24 +59,28 @@ jobs: npm-token: ${{ secrets.NPM_PUBLISH_TOKEN }} - name: Define version - run: npx nx release --git-commit=false --git-tag=false --preid=snapshot --specifier=${{steps.set-version.outputs.version}} --dry-run + run: npx nx release version --git-commit=false --git-tag=false --preid=snapshot --specifier=${{steps.set-version.outputs.version}} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Build + run: npx nx run-many -t build --projects=tag:scope:release + + - name: Pre-Publish + run: npx nx run pre-publish + + - name: Publish + run: npx nx release publish --tag=snapshot + - name: Create comment - uses: peter-evans/create-or-update-comment@v3 + uses: peter-evans/create-or-update-comment@v4 with: comment-id: ${{ github.event.comment.id }} body: | - 🚀 Snapshot `${{ steps.set-version.outputs.version }}` is published! [Action](${{ steps.action-url.outputs.url }}) - # - name: Build - # run: npx nx run-many -t build --projects=tag:scope:release - - # - name: Pre-Publish - # run: npx nx run pre-publish + ## 🚀 Snapshot - # - name: Publish - # run: npx nx release publish --tag=snapshot + `${{ steps.set-version.outputs.version }}` is published! + [Action](${{ steps.action-url.outputs.url }}) - # - name: Git Reset - # run: git reset --hard + - name: Git Reset + run: git reset --hard