Skip to content

Commit

Permalink
chore: remove martinbeentjes/npm-get-version-action (#887)
Browse files Browse the repository at this point in the history
  • Loading branch information
acalcutt authored Dec 7, 2024
1 parent 3eba8e4 commit e59c5e2
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@ jobs:
run: |
currentVersion="$( node -e "console.log(require('./package.json').version)" )"
isPublished="$( npm view @mapbox/node-pre-gyp versions --json | jq -c --arg cv "$currentVersion" 'any(. == $cv)' )"
echo "version=$currentVersion" >> "$GITHUB_OUTPUT"
echo "published=$isPublished" >> "$GITHUB_OUTPUT"
echo "currentVersion: $currentVersion"
echo "isPublished: $isPublished"
outputs:
published: ${{ steps.check.outputs.published }}
version: ${{ steps.check.outputs.version }}

publish:
needs: release-check
Expand Down Expand Up @@ -58,15 +60,11 @@ jobs:
- run: npm run build --if-present

- run: npm test

- name: Get version
id: package-version
uses: martinbeentjes/[email protected]

- name: Prepare release changelog
id: prepare_release
run: |
RELEASE_TYPE="$(node -e "console.log(require('semver').prerelease('${{ steps.package-version.outputs.current-version }}') ? 'prerelease' : 'regular')")"
RELEASE_TYPE="$(node -e "console.log(require('semver').prerelease('${{ needs.release-check.outputs.version }}') ? 'prerelease' : 'regular')")"
if [[ $RELEASE_TYPE == 'regular' ]]; then
echo "prerelease=false" >> "$GITHUB_OUTPUT"
else
Expand All @@ -75,16 +73,16 @@ jobs:
- name: Extract changelog for version
run: |
awk '/^##/ { p = 0 }; p == 1 { print }; $0 == "## ${{ steps.package-version.outputs.current-version }}" { p = 1 };' CHANGELOG.md > changelog_for_version.md
awk '/^##/ { p = 0 }; p == 1 { print }; $0 == "## ${{ needs.release-check.outputs.version }}" { p = 1 };' CHANGELOG.md > changelog_for_version.md
cat changelog_for_version.md
- name: Publish to Github
uses: ncipollo/release-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag: v${{ steps.package-version.outputs.current-version }}
name: v${{ steps.package-version.outputs.current-version }}
tag: v${{ needs.release-check.outputs.version }}
name: v${{ needs.release-check.outputs.version }}
bodyFile: changelog_for_version.md
allowUpdates: true
draft: false
Expand Down

0 comments on commit e59c5e2

Please sign in to comment.