Merge pull request #3 from mrmilu/release/autogenerate_destination_dir #9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
workflow_dispatch: | |
push: | |
branches: [main] | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.BOT_ACCESS_TOKEN }} | |
- name: git config user | |
run: | | |
git config --global user.name mrm-dev | |
git config --global user.email [email protected] | |
- name: Setup Node.js environment | |
uses: actions/[email protected] | |
with: | |
node-version: "18" | |
- name: Install dependencies | |
run: | | |
corepack enable | |
pnpm install | |
- name: Release | |
run: | | |
pnpm release | |
git push --follow-tags origin main | |
pnpm build | |
- name: Publish | |
uses: JS-DevTools/npm-publish@v1 | |
with: | |
token: ${{ secrets.NPM_TOKEN }} | |
package: "./package.json" | |
- name: Set env for last tag release | |
run: echo "LAST_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV | |
- name: Post to a Slack channel | |
id: slack | |
uses: slackapi/[email protected] | |
with: | |
channel-id: "C03BJMKFZHV" | |
payload: | | |
{ | |
"blocks": [ | |
{ | |
"type": "section", | |
"text": { | |
"type": "mrkdwn", | |
"text": ":robot_face: New Inversify Generator release :robot_face:\n*<https://github.com/mrmilu/inversify_generator/blob/master/CHANGELOG.md|${{ env.LAST_TAG }}>*" | |
} | |
} | |
] | |
} | |
env: | |
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} |