Continuous Deployment #52
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: Continuous Deployment | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| releaseType: | |
| description: The type of release. Should be one of "major", "minor", "patch" | |
| required: true | |
| default: 'patch' | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| id-token: write # required for npm trusted publishing | |
| issues: write | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| # Only run on workflow dispatch to main branch | |
| if: github.ref == 'refs/heads/main' && github.repository == '2060-io/react-native-eid-reader' && github.event_name == 'workflow_dispatch' | |
| steps: | |
| - name: Checkout react-native-eid-reader | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: git config | |
| run: | | |
| git config user.name "@github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| - name: Setup node v22 | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22.14.0' | |
| cache: yarn | |
| # anchor to the smallest npm version supporting trusted publishing | |
| - name: Update npm | |
| run: npm install -g npm@11.11.0 | |
| - name: Set Verbose Logging | |
| run: npm config set loglevel verbose --global | |
| - name: Install dependencies | |
| run: yarn install --immutable | |
| - name: Build the library | |
| run: yarn prepare | |
| - name: Release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: yarn release ${{ github.event.inputs.releaseType }} --ci |