Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 982eeecabc | |||
| 04a8c95ad6 | |||
| 8fec5d9898 | |||
| 0785b5a571 |
48
.gitea/workflows/release.yml
Normal file
48
.gitea/workflows/release.yml
Normal file
@@ -0,0 +1,48 @@
|
||||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "v*"
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: denoland/setup-deno@v2
|
||||
with:
|
||||
deno-version: v2.x
|
||||
|
||||
- name: Compile Windows exe
|
||||
run: |
|
||||
deno compile \
|
||||
--allow-net --allow-read --allow-write \
|
||||
--include desktop.html \
|
||||
--include mobile.html \
|
||||
--include obs.html \
|
||||
--target x86_64-pc-windows-msvc \
|
||||
--output elden-counter.exe \
|
||||
server.ts
|
||||
|
||||
- name: Publish release
|
||||
env:
|
||||
GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GITEA_URL: ${{ github.server_url }}
|
||||
REPO: ${{ github.repository }}
|
||||
TAG: ${{ github.ref_name }}
|
||||
run: |
|
||||
# Create the release
|
||||
RELEASE=$(curl -s -X POST "$GITEA_URL/api/v1/repos/$REPO/releases" \
|
||||
-H "Authorization: token $GITEA_TOKEN" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{\"tag_name\":\"$TAG\",\"name\":\"$TAG\",\"draft\":false,\"prerelease\":false}")
|
||||
RELEASE_ID=$(echo "$RELEASE" | grep -o '"id":[0-9]*' | head -1 | cut -d: -f2)
|
||||
|
||||
# Upload the exe as a release asset
|
||||
curl -s -X POST "$GITEA_URL/api/v1/repos/$REPO/releases/$RELEASE_ID/assets" \
|
||||
-H "Authorization: token $GITEA_TOKEN" \
|
||||
-H "Content-Type: application/octet-stream" \
|
||||
--data-binary @elden-counter.exe \
|
||||
-G --data-urlencode "name=elden-counter.exe"
|
||||
Reference in New Issue
Block a user