- Checks if release already exists for the tag - Automatically deletes conflicting release if found - Prevents duplicate/stale releases when recreating tags - Ensures fresh binaries when tag is recreated This fixes the issue where recreating a tag would keep old release with outdated binaries.
Gitea Actions Workflows
This directory contains automated workflows for NUPST's CI/CD pipeline.
Workflows
CI Workflow (ci.yml
)
Triggers:
- Push to
main
branch - Push to
migration/**
branches - Pull requests to
main
Jobs:
-
Type Check & Lint
- Runs
deno check
for TypeScript validation - Runs
deno lint
(continues on error) - Runs
deno fmt --check
(continues on error)
- Runs
-
Build Test (Current Platform)
- Compiles for Linux x86_64 (host platform)
- Tests binary execution (
--version
andhelp
)
-
Build All Platforms (Main/Tags only)
- Compiles all 5 platform binaries
- Uploads as artifacts (30-day retention)
- Only runs on
main
branch or tags
Release Workflow (release.yml
)
Triggers:
- Push tags matching
v*
(e.g.,v4.0.0
)
Jobs:
-
Version Verification
- Extracts version from tag
- Verifies
deno.json
version matches tag - Fails if mismatch detected
-
Compilation
- Compiles binaries for all 5 platforms:
nupst-linux-x64
(Linux x86_64)nupst-linux-arm64
(Linux ARM64)nupst-macos-x64
(macOS Intel)nupst-macos-arm64
(macOS Apple Silicon)nupst-windows-x64.exe
(Windows x64)
- Compiles binaries for all 5 platforms:
-
Checksums
- Generates SHA256 checksums for all binaries
- Creates
SHA256SUMS.txt
-
Release Creation
- Creates Gitea release with tag
- Extracts release notes from CHANGELOG.md (if exists)
- Uploads all binaries + checksums as release assets
Creating a Release
Prerequisites
-
Update version in
deno.json
:{ "version": "4.0.0" }
-
Update
CHANGELOG.md
with release notes (optional but recommended) -
Commit all changes:
git add . git commit -m "chore: bump version to 4.0.0"
Release Process
-
Create and push a tag matching the version:
git tag v4.0.0 git push origin v4.0.0
-
Gitea Actions will automatically:
- Verify version consistency
- Compile all platform binaries
- Generate checksums
- Create release with binaries attached
-
Monitor the workflow:
- Go to:
https://code.foss.global/serve.zone/nupst/actions
- Check the "Release" workflow run
- Go to:
Manual Release (Fallback)
If workflows fail, you can create a release manually:
# Compile all binaries
bash scripts/compile-all.sh
# Generate checksums
cd dist/binaries
sha256sum * > SHA256SUMS.txt
cd ../..
# Create release on Gitea UI
# Upload binaries manually
Troubleshooting
Version Mismatch Error
If the release workflow fails with "Version mismatch":
- Ensure
deno.json
version matches the git tag - Example: tag
v4.0.0
requires"version": "4.0.0"
in deno.json
Compilation Errors
If compilation fails:
- Test locally:
bash scripts/compile-all.sh
- Check Deno version compatibility
- Review TypeScript errors:
deno check mod.ts
Upload Failures
If binary upload fails:
- Check Gitea Actions permissions
- Verify
GITHUB_TOKEN
secret exists (auto-provided by Gitea) - Try manual release creation
Workflow Secrets
The workflows use the following secrets:
GITHUB_TOKEN
- Auto-provided by Gitea Actions (no setup needed)
Development
Testing Workflows Locally
You can test compilation locally:
# Install Deno
curl -fsSL https://deno.land/install.sh | sh
# Test type checking
deno check mod.ts
# Test compilation
bash scripts/compile-all.sh
# Test binary
./dist/binaries/nupst-linux-x64 --version
Modifying Workflows
After modifying workflows:
- Test syntax: Use a YAML validator
- Commit changes:
git add .gitea/workflows/
- Push to feature branch first to test CI
- Merge to main once verified
Links
- Gitea Actions Documentation: https://docs.gitea.com/usage/actions/overview
- Deno Compile Documentation: https://docs.deno.com/runtime/manual/tools/compiler
- NUPST Repository: https://code.foss.global/serve.zone/nupst