Skip to content

Commit

Permalink
create auto publish latest pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
frontegg-david committed Jan 8, 2024
1 parent 781c8f1 commit 0f5c337
Showing 1 changed file with 39 additions and 40 deletions.
79 changes: 39 additions & 40 deletions .github/workflows/onReleaseMerged.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ env:
CI: true
jobs:
publish:
name: 'Install | Build | Test'
if: "contains(join(github.event.pull_request.labels.*.name, ','), 'Release') && github.event.pull_request.merged == true"
name: 'Build | Publish'
runs-on: macos-12
steps:
- name: Checkout
Expand Down Expand Up @@ -37,9 +38,10 @@ jobs:
env:
NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}

- name: Install Package
- name: Build Packages
run: |
npm i
npm run build
- name: Set Current Version
id: set_current_version
if: startsWith(github.event.pull_request.title, 'v')
Expand All @@ -61,47 +63,44 @@ jobs:
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# - name: Create Git Tag
# if: steps.tag_check.outputs.exists_tag == 'false'
# uses: azu/action-package-version-to-git-tag@v1
# with:
# version: ${{ steps.set_current_version.outputs.CURRENT_VERSION }}
# github_token: ${{ secrets.GITHUB_TOKEN }}
# github_repo: ${{ github.repository }}
# git_commit_sha: ${{ github.sha }}
# git_tag_prefix: "v"

# - name: Create Release
# id: create_release
# if: steps.tag_check.outputs.exists_tag == 'false'
# uses: actions/create-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# tag_name: v${{ steps.set_current_version.outputs.CURRENT_VERSION }}
# release_name: ${{ github.event.pull_request.title }}
# body: |
# ${{ github.event.pull_request.body }}
# draft: false
# prerelease: false

- name: Publish @frontegg/ionic-capacitor version to NPM
- name: Create Git Tag
if: steps.tag_check.outputs.exists_tag == 'false'
uses: azu/action-package-version-to-git-tag@v1
with:
version: ${{ steps.set_current_version.outputs.CURRENT_VERSION }}
github_token: ${{ secrets.GITHUB_TOKEN }}
github_repo: ${{ github.repository }}
git_commit_sha: ${{ github.sha }}
git_tag_prefix: "v"
- name: Create Release
id: create_release
if: steps.tag_check.outputs.exists_tag == 'false'
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.set_current_version.outputs.CURRENT_VERSION }}
release_name: ${{ github.event.pull_request.title }}
body: |
${{ github.event.pull_request.body }}
draft: false
prerelease: false
- name: Publish @frontegg/react-native version to NPM
run: npm publish --tag latest
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
# - name: Notify Slack on deployment
# uses: rtCamp/action-slack-notify@v2
# env:
# SLACK_CHANNEL: Production
# SLACK_COLOR: ${{ job.status }}
# SLACK_ICON: https://avatars.githubusercontent.com/u/67857107?s=40&v=4
# SLACK_MESSAGE: '${{ github.actor }} has deployed @frontegg/react-native version: ${{ steps.set_current_version.outputs.CURRENT_VERSION }} :rocket:'
# SLACK_TITLE: '@frontegg/react-native version: ${{ steps.set_current_version.outputs.CURRENT_VERSION }} has been successfully published'
# SLACK_USERNAME: ${{ github.actor }}
# SLACK_WEBHOOK: ${{ secrets.SLACK_PRODUCTION_TOKEN }}
# MSG_MINIMAL: Commit,actions url
- name: Notify Slack on deployment
uses: rtCamp/action-slack-notify@v2
env:
SLACK_CHANNEL: Production
SLACK_COLOR: ${{ job.status }}
SLACK_ICON: https://avatars.githubusercontent.com/u/67857107?s=40&v=4
SLACK_MESSAGE: '${{ github.actor }} has deployed @frontegg/react-native version: ${{ steps.set_current_version.outputs.CURRENT_VERSION }} :rocket:'
SLACK_TITLE: '@frontegg/react-native version: ${{ steps.set_current_version.outputs.CURRENT_VERSION }} has been successfully published'
SLACK_USERNAME: ${{ github.actor }}
SLACK_WEBHOOK: ${{ secrets.SLACK_PRODUCTION_TOKEN }}
MSG_MINIMAL: Commit,actions url
- uses: actions/[email protected]
with:
github-token: ${{secrets.GITHUB_TOKEN}}
Expand Down

0 comments on commit 0f5c337

Please sign in to comment.