diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 0000000..d44cb33 --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,20 @@ +name: Publish +on: + workflow_call: + +permissions: + contents: read + id-token: write # Required for OIDC + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 + with: + node-version: 24 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - name: npm release + run: | + npm ci + npm publish diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 90a3793..eab8e2b 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -19,6 +19,9 @@ jobs: actions: write runs-on: ubuntu-latest steps: + - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 + with: + node-version: 24 - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - run: npm install - run: npm test @@ -90,6 +93,9 @@ jobs: platform: ios pm: yarn steps: + - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 + with: + node-version: 24 - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: path: react-native-hcaptcha @@ -141,18 +147,8 @@ jobs: filename: .github/examples-issue-template.md release: - permissions: - contents: read + runs-on: ubuntu-latest if: github.event_name == 'release' needs: test - runs-on: ubuntu-latest steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - - name: npm release - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - run: | - npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN - npm ci - npm publish + - uses: ./.github/workflows/publish.yaml diff --git a/.gitignore b/.gitignore index f78c883..edfdf7d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ node_modules/* yarn.lock +.idea # Reassure performance testing files .reassure/