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 - vue - eslint-plugin - stylelint-plugin - postcss-responsive-variations - dialtone-mcp-server - dialtone-cli 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 }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - name: Checkout uses: actions/checkout@v4 with: fetch-depth: 0 token: ${{ secrets.DIALTONE_CI_TOKEN }} - name: Setup Environment uses: ./.github/actions/setup-environment # 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 == 'vue' }} run: pnpm nx run dialtone-vue: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 CLI ${{ env.RELEASE_TAG }} if: ${{ github.event_name == 'schedule' || github.event.inputs.package == 'all' || github.event.inputs.package == 'dialtone-cli' }} run: pnpm nx run dialtone-cli: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