From 012fbad0a59a48fcc272d929e7f21fce7162a636 Mon Sep 17 00:00:00 2001 From: Jannik Zinkl Date: Wed, 5 Jul 2023 10:39:07 +0200 Subject: [PATCH] ci: adding semantic release --- .github/workflows/release.yml | 43 +++++++++++++++++++++++++++++++++++ package.json | 12 ++++++++-- 2 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..e5b1b97 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,43 @@ +name: Release +on: + push: + branches: + - main + +permissions: + contents: read # for checkout + +jobs: + release: + name: Release + runs-on: ubuntu-latest + permissions: + contents: write # to be able to publish a GitHub release + issues: write # to be able to comment on released issues + pull-requests: write # to be able to comment on released pull requests + id-token: write # to enable use of OIDC for npm provenance + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - uses: pnpm/action-setup@v2 + with: + version: 8.6.1 + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: "lts/*" + cache: "pnpm" + + - name: Install dependencies + run: pnpm i + - name: Verify the integrity of provenance attestations and registry signatures for installed dependencies + run: pnpm audit signatures + - name: Build package + run: pnpm build + - name: Release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + run: npx semantic-release \ No newline at end of file diff --git a/package.json b/package.json index 1178f7f..16e938d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "strapi-provider-cloudflare-r2", - "version": "0.1.12", + "version": "0.0.0-development", "description": "Strapi Cloudflare R2+CDN provider for strapi upload", "strapi": { "name": "strapi-provider-cloudflare-r2", @@ -34,7 +34,8 @@ } ], "scripts": { - "test": "echo \"no tests yet\"" + "test": "echo \"no tests yet\"", + "semantic-release": "semantic-release" }, "release": { "branches": [ @@ -54,5 +55,12 @@ "engines": { "node": ">=14.19.1 <=19.x.x", "npm": ">=6.0.0" + }, + "repository": { + "type": "git", + "url": "https://github.com/trieb-work/strapi-provider-cloudflare-r2.git" + }, + "devDependencies": { + "semantic-release": "^21.0.7" } }