Compare commits
4
Commits
0848cd51be
..
v0.1.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fbc836d9c4 | ||
|
|
de9d537a75 | ||
|
|
23a3f00df9 | ||
|
|
0a3225035c |
No files matched your search
@@ -0,0 +1,81 @@
|
|||||||
|
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
|
||||||
|
|
||||||
|
json_id() { node -e 'let d="";process.stdin.on("data",c=>d+=c).on("end",()=>{const j=JSON.parse(d||"{}");if(j.id==null){console.error("no release id:",JSON.stringify(j));process.exit(1)}console.log(j.id)})'; }
|
||||||
|
|
||||||
|
release_id=$(
|
||||||
|
curl -s -o /tmp/rel.json -w "%{http_code}" \
|
||||||
|
-H "Authorization: token $GITEA_TOKEN" \
|
||||||
|
"$GITEA_API/repos/$REPO/releases/tags/$TAG"
|
||||||
|
)
|
||||||
|
|
||||||
|
if [ "$release_id" = "200" ]; then
|
||||||
|
echo "Release for $TAG already exists; reusing it."
|
||||||
|
release_id=$(json_id < /tmp/rel.json)
|
||||||
|
else
|
||||||
|
echo "Creating release for $TAG."
|
||||||
|
release_id=$(
|
||||||
|
curl -s -o /tmp/rel.json -w "%{http_code}" -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"
|
||||||
|
)
|
||||||
|
case "$release_id" in
|
||||||
|
201|200) release_id=$(json_id < /tmp/rel.json) ;;
|
||||||
|
*) echo "::error::release create returned HTTP $release_id: $(cat /tmp/rel.json)"; exit 1 ;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Uploading asset to release $release_id."
|
||||||
|
resp=$(curl -s -o /tmp/att.json -w "%{http_code}" -X POST \
|
||||||
|
-H "Authorization: token $GITEA_TOKEN" \
|
||||||
|
-F "attachment=@vidplex-${TAG}.zip" \
|
||||||
|
"$GITEA_API/repos/$REPO/releases/$release_id/assets")
|
||||||
|
if [ "$resp" != "200" ] && [ "$resp" != "201" ]; then
|
||||||
|
echo "::error::asset upload returned HTTP $resp: $(cat /tmp/att.json)"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
cat /tmp/att.json
|
||||||
|
echo
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"manifest_version": 3,
|
"manifest_version": 3,
|
||||||
"name": "VidPlex",
|
"name": "VidPlex",
|
||||||
"version": "0.1.0",
|
"version": "0.1.1",
|
||||||
"description": "Find videos on any page and view them in a grid.",
|
"description": "Find videos on any page and view them in a grid.",
|
||||||
"permissions": [
|
"permissions": [
|
||||||
"storage",
|
"storage",
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "vidplex",
|
"name": "vidplex",
|
||||||
"version": "0.1.0",
|
"version": "0.1.1",
|
||||||
"private": true,
|
"private": true,
|
||||||
"description": "Chrome extension: find videos on a page and view them in a grid.",
|
"description": "Chrome extension: find videos on a page and view them in a grid.",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
|||||||
Reference in new issue
Block a user