initial commit
This commit is contained in:
67
.gitea/workflows/build.yml
Normal file
67
.gitea/workflows/build.yml
Normal file
@@ -0,0 +1,67 @@
|
||||
name: build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- feature-*
|
||||
tags:
|
||||
- "v*"
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
name: lint
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "24"
|
||||
cache: "pnpm"
|
||||
|
||||
- name: Enable corepack
|
||||
run: corepack enable
|
||||
|
||||
- name: Install deps
|
||||
run: pnpm install --frozen-lockfile
|
||||
|
||||
- name: Lint
|
||||
run: pnpm run lint
|
||||
|
||||
build:
|
||||
name: build
|
||||
runs-on: ubuntu-latest
|
||||
needs: [lint]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "24"
|
||||
cache: "pnpm"
|
||||
|
||||
- name: Enable corepack
|
||||
run: corepack enable
|
||||
|
||||
- name: Install deps
|
||||
run: pnpm install --frozen-lockfile
|
||||
|
||||
- name: Build (skip lint in build)
|
||||
env:
|
||||
NEXT_DISABLE_ESLINT: "1"
|
||||
run: pnpm run build
|
||||
|
||||
- name: Upload build artifacts
|
||||
if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: polynote-next-build
|
||||
path: |
|
||||
.next/standalone
|
||||
.next/static
|
||||
public
|
||||
95
.gitea/workflows/build.yml.bak
Normal file
95
.gitea/workflows/build.yml.bak
Normal file
@@ -0,0 +1,95 @@
|
||||
name: Build & Publish Binaries
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- feature-*
|
||||
- main
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
name: Lint
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: "1.25.5"
|
||||
|
||||
- name: Run golangci-lint
|
||||
uses: golangci/golangci-lint-action@v7
|
||||
with:
|
||||
args: --timeout=5m
|
||||
|
||||
test:
|
||||
name: Test
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: '1.25.5'
|
||||
|
||||
- name: Run tests
|
||||
run: go test -cover ./...
|
||||
|
||||
build:
|
||||
name: Build
|
||||
runs-on: ubuntu-latest
|
||||
needs: [lint, test]
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: '1.25.5'
|
||||
|
||||
- name: Build binaries (Linux & Windows)
|
||||
run: make build-all
|
||||
|
||||
- name: List built binaries
|
||||
run: ls -lh ./bin/
|
||||
|
||||
- name: Collect tag name
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
id: vars
|
||||
run: echo "tag=${GITHUB_REF_NAME}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Create release
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
id: create_release
|
||||
uses: actions/create-release@v1
|
||||
with:
|
||||
tag_name: ${{ steps.vars.outputs.tag }}
|
||||
release_name: Release ${{ steps.vars.outputs.tag }}
|
||||
draft: false
|
||||
prerelease: false
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.CI_PIPELINE }}
|
||||
|
||||
- name: Upload release binaries
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
env:
|
||||
TOKEN: ${{ secrets.CI_PIPELINE }}
|
||||
URL: ${{ steps.create_release.outputs.upload_url }}
|
||||
run: |
|
||||
set -eo pipefail
|
||||
for FILE in ./bin/*; do
|
||||
NAME=$(basename "$FILE")
|
||||
echo "🔼 Uploading $NAME ..."
|
||||
curl -sS -X POST -H "Authorization: token $TOKEN" \
|
||||
-H "Content-Type: application/octet-stream" \
|
||||
--data-binary @"$FILE" \
|
||||
"$URL?name=$NAME" \
|
||||
-w "\n→ HTTP %{http_code} for $NAME\n"
|
||||
done
|
||||
Reference in New Issue
Block a user