chore(release): NO-JIRA dialtone/v9.155.4 #101
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 Android | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| package: | |
| description: 'Select the package you want to publish' | |
| required: true | |
| default: 'dialtone-tokens' | |
| type: 'choice' | |
| options: | |
| - dialtone-tokens | |
| - dialtone-icons | |
| push: | |
| branches: | |
| - production | |
| paths: | |
| - '**/gradle.properties' | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| jobs: | |
| filter-actions: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| packages: ${{ github.event_name == 'push' && steps.filter-path.outputs.changes || steps.filter-input.outputs.package }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Filter actions by path | |
| if: ${{ github.event_name == 'push' }} | |
| uses: dorny/paths-filter@v3 | |
| id: filter-path | |
| with: | |
| base: ${{ github.ref }} | |
| list-files: 'json' | |
| filters: | | |
| dialtone-icons: | |
| - 'packages/dialtone-icons/android/gradle.properties' | |
| dialtone-tokens: | |
| - 'packages/dialtone-tokens/gradle.properties' | |
| - name: Filter actions by input | |
| if: ${{ github.event_name == 'workflow_dispatch' }} | |
| id: filter-input | |
| run: | | |
| echo 'package=["${{ github.event.inputs.package }}"]' >> $GITHUB_OUTPUT | |
| 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 | |
| with: | |
| route: GET /orgs/dialpad/members/${{ github.actor }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.DIALTONE_CI_TOKEN }} | |
| publish: | |
| needs: [ check-dialpad-member, filter-actions ] | |
| if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && needs.filter-actions.outputs.packages != '[]') }} | |
| strategy: | |
| matrix: | |
| package: ${{ fromJSON(needs.filter-actions.outputs.packages) }} | |
| runs-on: ubuntu-latest | |
| permissions: | |
| packages: write | |
| steps: | |
| - name: Set working Dir | |
| run: | | |
| echo "WORKING_DIR=${{ matrix.package == 'dialtone-icons' && './packages/dialtone-icons/android' || './packages/dialtone-tokens' }}" >> $GITHUB_ENV | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Environment | |
| uses: ./.github/actions/setup-environment | |
| - name: Setup Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 17 | |
| distribution: 'temurin' | |
| cache: 'gradle' | |
| cache-dependency-path: | | |
| ${{ env.WORKING_DIR }}/*.gradle* | |
| ${{ env.WORKING_DIR }}/**/gradle-wrapper.properties | |
| - name: Build ${{ matrix.package }} | |
| run: pnpm nx run ${{ matrix.package }}:build:android | |
| - name: Publish ${{ matrix.package }} | |
| working-directory: ${{ env.WORKING_DIR }} | |
| env: | |
| GITHUB_USER: braddialpad | |
| run: ./gradlew publish |