From 0a3225035c938a1400dea510e25d403a9826285e Mon Sep 17 00:00:00 2001 From: kfj001 Date: Sun, 30 Aug 2026 23:31:12 -0700 Subject: [PATCH] ci: add tag-based Gitea release workflow + bump to 0.1.1 --- .github/workflows/release.yml | 54 +++++++++++++++++++++++++++++++++++ manifest.json | 2 +- package.json | 2 +- 3 files changed, 56 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..44fb759 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,54 @@ +name: Release + +on: + push: + tags: + - 'v*' + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 22 + + - name: Install dependencies + run: npm ci + + - name: Build + run: npm run build + + - name: Package dist.zip + shell: bash + run: | + cd dist + zip -r "../vidplex-${{ github.ref_name }}.zip" . + + - name: Create Gitea release + shell: bash + env: + GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} + GITEA_API: ${{ secrets.GITEA_API || 'http://192.168.1.74:30008/api/v1' }} + REPO: ${{ github.repository }} + TAG: ${{ github.ref_name }} + run: | + if [ -z "$GITEA_TOKEN" ]; then + echo "::warning::GITEA_TOKEN secret is not set; skipping release creation. Add it in Gitea repo Settings > Secrets (repo scope)." + exit 0 + fi + + release_id=$(curl -s -X POST \ + -H "Authorization: token $GITEA_TOKEN" \ + -H "Content-Type: application/json" \ + -d "{\"tag_name\": \"$TAG\", \"name\": \"$TAG\", \"body\": \"Automated release build for $TAG\"}" \ + "$GITEA_API/repos/$REPO/releases" | node -e 'let d="";process.stdin.on("data",c=>d+=c).on("end",()=>{const j=JSON.parse(d);if(j.id==null){console.error("release create failed:",JSON.stringify(j));process.exit(1)}console.log(j.id)})') + + curl -s -X POST \ + -H "Authorization: token $GITEA_TOKEN" \ + -F "file=@vidplex-${TAG}.zip" \ + "$GITEA_API/repos/$REPO/releases/$release_id/_attachments" \ No newline at end of file diff --git a/manifest.json b/manifest.json index d1dc5f0..960e2f7 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 3, "name": "VidPlex", - "version": "0.1.0", + "version": "0.1.1", "description": "Find videos on any page and view them in a grid.", "permissions": [ "storage", diff --git a/package.json b/package.json index 47bb73a..4874d1a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vidplex", - "version": "0.1.0", + "version": "0.1.1", "private": true, "description": "Chrome extension: find videos on a page and view them in a grid.", "type": "module", -- 2.54.0