From 1a3c174c49bff2ae9315b88512ebaa7b3d2fdb24 Mon Sep 17 00:00:00 2001 From: xenticore Date: Fri, 21 Mar 2025 14:03:15 -0400 Subject: [PATCH] ci: create releases on tags, builds on push and PR --- .gitea/workflows/{ci.yaml => build.yaml} | 0 .gitea/workflows/release.yaml | 46 ++++++++++++++++++++++++ 2 files changed, 46 insertions(+) rename .gitea/workflows/{ci.yaml => build.yaml} (100%) create mode 100644 .gitea/workflows/release.yaml diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/build.yaml similarity index 100% rename from .gitea/workflows/ci.yaml rename to .gitea/workflows/build.yaml diff --git a/.gitea/workflows/release.yaml b/.gitea/workflows/release.yaml new file mode 100644 index 0000000..640ee90 --- /dev/null +++ b/.gitea/workflows/release.yaml @@ -0,0 +1,46 @@ +name: CI + +on: + push: + tags: + - '*' + +jobs: + build: + runs-on: debian-latest + + steps: + - name: Check out repository + uses: actions/checkout@v4.1.2 + - name: Install dependencies + run: bun install + - name: Build project + run: bun run build + - name: Archive production artifacts + uses: actions/upload-artifact@v3 + with: + name: tf2wikipricing.user.js + path: | + dist/userscript/tf2wikipricing.user.js + - name: Read package.json version + uses: tyankatsu0105/read-package-version-actions@v1 + id: version + - name: Create release + uses: actions/create-release@v1 + id: create_release + with: + draft: false + prerelease: false + release_name: ${{ steps.version.outputs.version }} + tag_name: ${{ github.ref }} + env: + GITHUB_TOKEN: ${{ github.token }} + - name: Upload release artifacts + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ github.token }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: dist/userscript/tf2wikipricing.user.js + asset_name: tf2wikipricing.user.js + asset_content_type: text/javascript \ No newline at end of file