Skip to content

Commit

Permalink
output instead of env
Browse files Browse the repository at this point in the history
  • Loading branch information
osipov-mit committed Nov 27, 2024
1 parent e661732 commit 27d7102
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/js-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,19 @@ jobs:
echo "prev_version=$PREVIOUS_VERSION" >> $GITHUB_OUTPUT
- name: 'Compare versions'
id: release
run: |
if [ ${{ steps.info.outputs.version }} == ${{ steps.info.outputs.prev_version }} ]; then
echo "No new version to release"
echo "skip=true" >> $GITHUB_ENV
echo "skip=true" >> $GITHUB_OUTPUT
else
echo "New version to release"
echo "skip=false" >> $GITHUB_ENV
echo "skip=false" >> $GITHUB_OUTPUT
fi
- name: 'Get release notes'
id: release_notes
if: env.skip != 'true'
if: steps.release.outputs.skip != 'true'
run: |
awk '/## ${{ steps.info.outputs.version }}/{flag=1;next}/---/{flag=0} flag' ./js/CHANGELOG.md >> release_notes.txt
echo "release_notes<<EOF" >> $GITHUB_OUTPUT
Expand All @@ -50,27 +51,27 @@ jobs:
rm release_notes.txt
- name: 'Prepare: install dependencies and build pkgs'
if: env.skip != 'true'
if: steps.release.outputs.skip != 'true'
run: |
yarn install
yarn build
- name: 'Create new tag'
if: env.skip != 'true'
if: steps.release.outputs.skip != 'true'
run: |
git tag ${{ steps.info.outputs.tag_name }}
git push origin ${{ steps.info.outputs.tag_name }}
- name: 'Create Release'
if: env.skip != 'true'
if: steps.release.outputs.skip != 'true'
uses: softprops/action-gh-release@v2
with:
body: ${{ steps.release_notes.outputs.release_notes }}
tag_name: ${{ steps.info.outputs.tag_name }}
name: 'Sails-JS v${{ steps.info.outputs.version }}'

- name: 'Publish to npm registry'
if: env.skip != 'true'
if: steps.release.outputs.skip != 'true'
run: |
export token=$(printenv npm_token)
echo "//registry.npmjs.org/:_authToken=$token" > .npmrc
Expand Down

0 comments on commit 27d7102

Please sign in to comment.