add broadcast and log object #13
Workflow file for this run
This file contains hidden or 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: Publish Packages to npm | |
| on: | |
| push: | |
| tags: | |
| - 'v*' # Run on any tag that starts with v (e.g., v1.0.0) | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '18' | |
| registry-url: 'https://registry.npmjs.org/' | |
| scope: '@beekeeperstudio' | |
| - name: Get tag version | |
| id: get_version | |
| run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV | |
| - name: Install dependencies | |
| run: yarn install --frozen-lockfile | |
| - name: Update package version | |
| run: | | |
| yarn version --new-version $VERSION --no-git-tag-version | |
| - name: Build packages | |
| run: yarn build | |
| - name: Check if beta version | |
| id: check_beta | |
| run: | | |
| if [[ "$VERSION" == *"beta"* ]]; then | |
| echo "IS_BETA=true" >> $GITHUB_ENV | |
| echo "Publishing as beta version" | |
| else | |
| echo "IS_BETA=false" >> $GITHUB_ENV | |
| echo "Publishing as stable version" | |
| fi | |
| - name: Publish package (beta) | |
| if: env.IS_BETA == 'true' | |
| run: yarn publish --access public --non-interactive --tag beta | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| - name: Publish package (stable) | |
| if: env.IS_BETA == 'false' | |
| run: yarn publish --access public --non-interactive | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| # Create GitHub release for this version | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| name: Release ${{ env.VERSION }} | |
| body: | | |
| # Beekeeper Studio Plugin v${{ env.VERSION }} | |
| Published package: | |
| - @beekeeperstudio/plugin@${{ env.VERSION }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |