add vanilla builders

This commit is contained in:
eyedeekay
2025-05-26 17:16:11 -04:00
parent ee938a6537
commit aa66a4479d
2 changed files with 196 additions and 0 deletions

View File

@ -0,0 +1,101 @@
name: Forgejo Nightly Build
on:
push: # Run on any push
schedule:
- cron: '0 0 * * *' # Runs daily at midnight UTC
workflow_dispatch: # Allow manual triggers
permissions:
contents: write # Required for creating releases
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 120 # 2-hour timeout
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.24.3'
cache: true
- name: Setup node.js
uses: actions/setup-node@v3
with:
node-version: '20'
cache: 'npm'
- name: Checkout Forgejo Source
run: |
git clone https://codeberg.org/forgejo/forgejo.git forgejo-source
cd forgejo-source
git checkout forgejo
- name: Build Forgejo
working-directory: forgejo-source
run: |
make clean
cp -v ../net_mirror.go modules/graceful/net_mirror.go
cp -v ../net_mirror_dialer.go modules/graceful/net_mirror_dialer.go
cp -v ../net_mirror_unix.go modules/graceful/net_mirror_unix.go
cp -v ../net_mirror_windows.go modules/graceful/net_mirror_windows.go
grep -v 'github.com/go-i2p/go-gitlooseleaf' ../go.mod >> go.mod
grep -v 'go 1.2' ../go.mod >> go.mod
grep -v '// indirect' ../go.mod >> go.mod
go mod tidy
make build
env:
TAGS: bindata sqlite sqlite_unlock_notify netgo osusergo
GOFLAGS: -ldflags="-extldflags=-static"
CO_ENABLED: 0
- name: Prepare Artifact
shell: bash
run: |
cd forgejo-source
ARTIFACT_NAME="forgejo-${{ runner.os }}"
ls -lah
if [ "${{ runner.os }}" = "Windows" ]; then
mv -v gitea.exe "${ARTIFACT_NAME}.exe"
else
mv -v gitea "${ARTIFACT_NAME}"
fi
- name: Upload Build Artifact
uses: actions/upload-artifact@v4
with:
name: forgejo-${{ runner.os }}
path: |
forgejo-source/forgejo-${{ runner.os }}*
retention-days: 1
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download All Artifacts
uses: actions/download-artifact@v4
- name: Get Current Date
id: date
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
- name: Create or Update Nightly Release
uses: ncipollo/release-action@v1
with:
tag: forgejo-nightly
name: "Forgejo Nightly Build (${{ steps.date.outputs.date }})"
body: "Automated nightly build of Forgejo from main branch, built on ${{ steps.date.outputs.date }}"
artifacts: "forgejo-Linux/*, forgejo-Windows/*, forgejo-macOS/*"
draft: false
prerelease: true
allowUpdates: true
removeArtifacts: false
replacesArtifacts: true

View File

@ -0,0 +1,95 @@
name: Gitea Nightly Build
on:
push: # Run on any push
schedule:
- cron: '0 0 * * *' # Runs daily at midnight UTC
workflow_dispatch: # Allow manual triggers
permissions:
contents: write # Required for creating releases
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 120 # 2-hour timeout
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.24'
cache: true
- name: Checkout Gitea Source
uses: actions/checkout@v4
with:
repository: go-gitea/gitea
ref: main # Always use the latest main branch
path: gitea-source
- name: Build Gitea
working-directory: gitea-source
run: |
make clean
cp -v ../net_mirror.go modules/graceful/net_mirror.go
cp -v ../net_mirror_dialer.go modules/graceful/net_mirror_dialer.go
cp -v ../net_mirror_unix.go modules/graceful/net_mirror_unix.go
cp -v ../net_mirror_windows.go modules/graceful/net_mirror_windows.go
grep -v 'github.com/go-i2p/go-gitlooseleaf' ../go.mod >> go.mod
grep -v 'go 1.2' ../go.mod >> go.mod
grep -v '// indirect' ../go.mod >> go.mod
go mod tidy
make build
env:
TAGS: bindata sqlite sqlite_unlock_notify netgo osusergo
GOFLAGS: -ldflags="-extldflags=-static"
CO_ENABLED: 0
- name: Prepare Artifact
shell: bash
run: |
cd gitea-source
ARTIFACT_NAME="gitea-${{ runner.os }}"
if [ "${{ runner.os }}" = "Windows" ]; then
mv gitea.exe "${ARTIFACT_NAME}.exe"
else
mv gitea "${ARTIFACT_NAME}"
fi
- name: Upload Build Artifact
uses: actions/upload-artifact@v4
with:
name: gitea-${{ runner.os }}
path: |
gitea-source/gitea-${{ runner.os }}*
retention-days: 1
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download All Artifacts
uses: actions/download-artifact@v4
- name: Get Current Date
id: date
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
- name: Create or Update Nightly Release
uses: ncipollo/release-action@v1
with:
tag: nightly
name: "Gitea Nightly Build (${{ steps.date.outputs.date }})"
body: "Automated nightly build of Gitea from main branch, built on ${{ steps.date.outputs.date }}"
artifacts: "gitea-Linux/*, gitea-Windows/*, gitea-macOS/*"
draft: false
prerelease: true
allowUpdates: true
removeArtifacts: false
replacesArtifacts: true