Skip to content

Commit

Permalink
Test unfurl
Browse files Browse the repository at this point in the history
  • Loading branch information
narin committed Oct 26, 2023
1 parent 74ae004 commit 5897213
Showing 1 changed file with 17 additions and 18 deletions.
35 changes: 17 additions & 18 deletions .github/workflows/publish-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,41 +49,40 @@ jobs:
echo "NPM Package name: $NPM_PACKAGE"
CURRENT_VERSION=$(jq -r .version package.json)
LATEST_VERSION=$(npm view @department-of-veterans-affairs/mobile-component-library versions --json | jq -r '.[-1]')
LATEST_VERSION=$(npm view $NPM_PACKAGE versions --json | jq -r '.[-1]')
echo "Latest NPM version: $LATEST_VERSION"
if [[ "$CURRENT_VERSION" != "$LATEST_VERSION" ]]; then
echo "Setting package.json version to $LATEST_VERSION"
npm version $LATEST_VERSION
fi
BUMP=${{ inputs.version_bump }}
echo "Bumping version: $BUMP"
if [[ "$BUMP" == "alpha" ]] || [[ "$BUMP" == "beta" ]]; then
npm version prerelease --preid $BUMP
# npm publish --access public --tolerate-republish --tag $BUMP
npm publish --access public --tolerate-republish --tag $BUMP
else
npm version $BUMP
# npm publish --access public --tolerate-republish
npm publish --access public --tolerate-republish
fi
NEW_VERSION=$(jq -r .version package.json)
echo "Updated version: $NEW_VERSION"
echo "NEW_VERSION=$NEW_VERSION" >> "$GITHUB_OUTPUT"
echo "GIT_TAG=${{ inputs.package }}-v$NEW_VERSION" >> "$GITHUB_OUTPUT"
# - name: Commit package.json changes and tag
# run: |
# git config --global user.name 'VA Automation Bot'
# git config --global user.email '[email protected]'
# git add package.json
# git commit -m '[TEST] Version bump: ${{ steps.bump-version.outputs.GIT_TAG }}'
# git push
# TAG=${{ steps.bump-version.outputs.GIT_TAG }}
# echo $TAG
# git tag -a $TAG -m $TAG
# git push origin $TAG
- name: Commit package.json changes and tag
run: |
git config --global user.name 'VA Automation Bot'
git config --global user.email '[email protected]'
git add package.json
git commit -m '[TEST] Version bump: ${{ steps.bump-version.outputs.GIT_TAG }}'
git push
TAG=${{ steps.bump-version.outputs.GIT_TAG }}
echo $TAG
git tag -a $TAG -m $TAG
git push origin $TAG
- name: Post to a Slack channel
id: slack
uses: slackapi/[email protected]
Expand All @@ -100,10 +99,10 @@ jobs:
"type": "section",
"text": {
"type": "mrkdwn",
"text": "${{ steps.bump-version.outputs.NEW_VERSION }} of ${{ steps.bump-version.outputs.NPM_PACKAGE_NAME }} has been published to NPM \n • <https://www.npmjs.com/package/${{ steps.bump-version.outputs.NPM_PACKAGE_NAME }}|NPM> \n • <https://github.com/department-of-veterans-affairs/va-mobile-library/releases/tag/${{ steps.bump-version.outputs.GIT_TAG }}|Git Tag>",
"unfurl_links": false,
"unfurl_media": false
"text": "${{ steps.bump-version.outputs.NEW_VERSION }} of ${{ steps.bump-version.outputs.NPM_PACKAGE_NAME }} has been published to NPM \n • <https://www.npmjs.com/package/${{ steps.bump-version.outputs.NPM_PACKAGE_NAME }}|NPM> \n • <https://github.com/department-of-veterans-affairs/va-mobile-library/releases/tag/${{ steps.bump-version.outputs.GIT_TAG }}|Git Tag>"
},
"unfurl_links": false,
"unfurl_media": false
}
]
}
Expand Down

0 comments on commit 5897213

Please sign in to comment.