Release packages #638
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: Release packages | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| package: | |
| type: 'choice' | |
| required: true | |
| description: 'Select a package to run the release' | |
| options: | |
| - all | |
| - dialtone | |
| - combinator | |
| - css | |
| - emojis | |
| - icons | |
| - language-server | |
| - tokens | |
| - vue2 | |
| - vue3 | |
| - eslint-plugin | |
| - stylelint-plugin | |
| - postcss-responsive-variations | |
| - dialtone-mcp-server | |
| schedule: | |
| - cron: "0 10 * * 2" | |
| permissions: | |
| packages: read | |
| env: | |
| HUSKY: 0 | |
| jobs: | |
| get-branch-name: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| current_branch: ${{ steps.branch-name.outputs.current_branch }} | |
| steps: | |
| - name: Get branch name | |
| id: branch-name | |
| uses: tj-actions/branch-names@v8 | |
| # check-dialpad-member: | |
| # runs-on: ubuntu-latest | |
| # steps: | |
| # # Will prevent the rest of the steps from running on fail | |
| # - name: Check if user is a dialpad member | |
| # uses: octokit/request-action@v2.x | |
| # env: | |
| # GITHUB_TOKEN: ${{ secrets.DIALTONE_CI_TOKEN }} | |
| # with: | |
| # route: GET /orgs/dialpad/members/${{ github.actor }} | |
| release: | |
| needs: [get-branch-name] | |
| if: ${{ contains(fromJSON('["staging", "alpha", "beta", "next"]'), needs.get-branch-name.outputs.current_branch) }} | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| packages: write | |
| issues: write | |
| pull-requests: write | |
| env: | |
| RELEASE_TAG: ${{ needs.get-branch-name.outputs.current_branch == 'staging' && 'latest' || needs.get-branch-name.outputs.current_branch }} | |
| DIALTONE_VUE3_RELEASE_TAG: ${{ needs.get-branch-name.outputs.current_branch == 'staging' && 'vue3' || needs.get-branch-name.outputs.current_branch }} | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| token: ${{ secrets.DIALTONE_CI_TOKEN }} | |
| - name: Use pnpm | |
| uses: pnpm/action-setup@v3 | |
| - name: Use Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: ".nvmrc" | |
| cache: "pnpm" | |
| registry-url: "https://npm.pkg.github.com" | |
| scope: "dialpad" | |
| env: | |
| NODE_AUTH_TOKEN: ${{ github.token }} | |
| - name: Install dependencies | |
| shell: bash | |
| run: pnpm install --frozen-lockfile | |
| # Release to GitHub | |
| - name: Release Dialtone Combinator ${{ env.RELEASE_TAG }} | |
| if: ${{ github.event_name == 'schedule' || github.event.inputs.package == 'all' || github.event.inputs.package == 'combinator' }} | |
| run: pnpm nx run dialtone-combinator:release | |
| - name: Release Dialtone CSS ${{ env.RELEASE_TAG }} | |
| if: ${{ github.event_name == 'schedule' || github.event.inputs.package == 'all' || github.event.inputs.package == 'css' }} | |
| run: pnpm nx run dialtone-css:release | |
| - name: Release Dialtone Emojis ${{ env.RELEASE_TAG }} | |
| if: ${{ github.event_name == 'schedule' || github.event.inputs.package == 'all' || github.event.inputs.package == 'emojis' }} | |
| run: pnpm nx run dialtone-emojis:release | |
| - name: Release Dialtone Icons ${{ env.RELEASE_TAG }} | |
| if: ${{ github.event_name == 'schedule' || github.event.inputs.package == 'all' || github.event.inputs.package == 'icons' }} | |
| run: pnpm nx run dialtone-icons:release | |
| - name: Release Dialtone Language server ${{ env.RELEASE_TAG }} | |
| if: ${{ github.event_name == 'schedule' || github.event.inputs.package == 'all' || github.event.inputs.package == 'language-server' }} | |
| run: pnpm nx run dialtone-language-server:release | |
| - name: Release Dialtone Tokens ${{ env.RELEASE_TAG }} | |
| if: ${{ github.event_name == 'schedule' || github.event.inputs.package == 'all' || github.event.inputs.package == 'tokens' }} | |
| run: pnpm nx run dialtone-tokens:release | |
| - name: Release Dialtone Vue@${{ env.RELEASE_TAG }} | |
| if: ${{ github.event_name == 'schedule' || github.event.inputs.package == 'all' || github.event.inputs.package == 'vue2' }} | |
| run: pnpm nx run dialtone-vue2:release | |
| - name: Release Dialtone Vue@${{ env.DIALTONE_VUE3_RELEASE_TAG }} | |
| if: ${{ github.event_name == 'schedule' || github.event.inputs.package == 'all' || github.event.inputs.package == 'vue3' }} | |
| run: pnpm nx run dialtone-vue3:release | |
| - name: Release Dialtone ESLint Plugin ${{ env.RELEASE_TAG }} | |
| if: ${{ github.event_name == 'schedule' || github.event.inputs.package == 'all' || github.event.inputs.package == 'eslint-plugin' }} | |
| run: pnpm nx run eslint-plugin-dialtone:release | |
| - name: Release Dialtone StyleLint Plugin ${{ env.RELEASE_TAG }} | |
| if: ${{ github.event_name == 'schedule' || github.event.inputs.package == 'all' || github.event.inputs.package == 'stylelint-plugin' }} | |
| run: pnpm nx run stylelint-plugin-dialtone:release | |
| - name: Release Dialtone PostCSS Responsive Variations Plugin ${{ env.RELEASE_TAG }} | |
| if: ${{ github.event_name == 'schedule' || github.event.inputs.package == 'all' || github.event.inputs.package == 'postcss-responsive-variations' }} | |
| run: pnpm nx run postcss-responsive-variations:release | |
| - name: Release Dialtone MCP Server ${{ env.RELEASE_TAG }} | |
| if: ${{ github.event_name == 'schedule' || github.event.inputs.package == 'all' || github.event.inputs.package == 'dialtone-mcp-server' }} | |
| run: pnpm nx run dialtone-mcp-server:release | |
| - name: Release Dialtone ${{ env.RELEASE_TAG }} | |
| if: ${{ github.event_name == 'schedule' || github.event.inputs.package == 'all' || github.event.inputs.package == 'dialtone' }} | |
| run: pnpm nx run dialtone:release | |
| update-production: | |
| needs: [ release ] | |
| if: ${{ needs.get-branch-name.outputs.current_branch == 'staging' }} | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: 'production' | |
| fetch-depth: 0 | |
| token: ${{ secrets.DIALTONE_CI_TOKEN }} | |
| - name: Merge changes to production | |
| run: | | |
| git merge --ff-only origin/staging | |
| git push |