diff options
| author | Valentin Popov <valentin@popov.link> | 2026-02-06 02:11:08 +0300 |
|---|---|---|
| committer | Valentin Popov <valentin@popov.link> | 2026-02-06 02:11:14 +0300 |
| commit | c20175cffbf0b567fd0fe1e344f4b928ed44b1ae (patch) | |
| tree | e9baeb42fff823d8b22a02c8c53418a57f3c16f6 /.github/workflows | |
| parent | 7714b04a3f6e6242b551ac6bba3ba175204730dc (diff) | |
| download | strapi-plugin-checkbox-list-c20175cffbf0b567fd0fe1e344f4b928ed44b1ae.tar.xz strapi-plugin-checkbox-list-c20175cffbf0b567fd0fe1e344f4b928ed44b1ae.zip | |
Add GitHub Actions workflow for publishing plugin
- Introduced a new workflow file (.github/workflows/publish.yml) to automate the publishing process for the plugin.
- Configured jobs for testing and publishing to NPM upon version tag pushes.
- Included steps for dependency installation, plugin building, and verification before publishing.
- Ensured integration tests are run in the playground environment before publishing the plugin.
Diffstat (limited to '.github/workflows')
| -rw-r--r-- | .github/workflows/publish.yml | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..fa7cf26 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,72 @@ +name: Publish + +on: + push: + tags: + - "v*" + +permissions: + contents: read + id-token: write + +jobs: + test: + name: Tests + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: "npm" + cache-dependency-path: | + package-lock.json + playground/package-lock.json + - name: Write playground .env + run: | + printf '%s' "${{ secrets.PLAYGROUND_ENV_BASE64 }}" | base64 -d > playground/.env + - name: Install root deps + run: npm ci + - name: Build plugin + run: npm run build + - name: Verify plugin + run: npm run verify + - name: Pack plugin into playground .yalc + run: | + TARBALL=$(npm pack --silent) + mkdir -p playground/.yalc/strapi-plugin-checkbox-list + tar -xzf "$TARBALL" -C playground/.yalc/strapi-plugin-checkbox-list --strip-components=1 + - name: Install playground deps + working-directory: playground + run: npm install + - name: Build playground + working-directory: playground + run: npm run build + - name: Integration tests + working-directory: playground + run: npm run test:integration + + publish: + name: Publish to NPM (Trusted Publisher) + runs-on: ubuntu-latest + needs: test + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 22 + registry-url: https://registry.npmjs.org/ + cache: "npm" + cache-dependency-path: package-lock.json + - name: Install deps + run: npm ci + - name: Build plugin + run: npm run build + - name: Verify plugin + run: npm run verify + - name: Publish + run: npm publish |
