diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 209877d..9cb1511 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -7,9 +7,13 @@ runs: - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: 20.x + node-version: '20.x' node-version-file: .nvmrc + - name: Upgrade npm for trusted publishing + run: npm install -g npm@latest + shell: bash + - name: Install dependencies run: | npm ci diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index fa9353d..1c80140 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -3,25 +3,26 @@ on: pull_request: types: [closed] branches: - - 'main' + - "main" push: tags: - - 'v*' + - "v*" + +permissions: + contents: write + id-token: write jobs: release_gh: - name: Create new GitHub release + name: Create new GitHub release if: contains(github.event.pull_request.labels.*.name, 'release') runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Setup Node - uses: actions/setup-node@v4 - with: - node-version: '20.x' - registry-url: 'https://registry.npmjs.org' + - name: Setup + uses: ./.github/actions/setup - name: git config run: | @@ -48,28 +49,17 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Setup Node - uses: actions/setup-node@v4 - with: - node-version: '20.x' - registry-url: 'https://registry.npmjs.org' - node-version-file: .nvmrc - - - name: Install dependencies - run: npm ci - shell: bash + - name: Setup + uses: ./.github/actions/setup - name: Compile .ts files run: npm run ts:build shell: bash - - name: Configure git run: | git config user.name "${GITHUB_ACTOR}" git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" - - - name: Publish package + + - name: Publish package run: npm publish - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/package.json b/package.json index e1638c5..6768d41 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "bugs": { "url": "https://github.com/talsec/Free-RASP-Capacitor/issues" }, + "homepage": "https://docs.talsec.app/freerasp", "keywords": [ "capacitor", "plugin",