mirror of
https://git.sanhost.net/sanasol/hytale-f2p
synced 2026-02-26 18:41:48 -03:00
Merge pull request #33 from sanasol/feature/build-releases
Github action to build binaries
This commit is contained in:
61
.github/README.md
vendored
Normal file
61
.github/README.md
vendored
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
# GitHub Actions
|
||||||
|
|
||||||
|
## Build and Release Workflow
|
||||||
|
|
||||||
|
The `release.yml` workflow automatically builds the launcher for all platforms.
|
||||||
|
|
||||||
|
### Triggers
|
||||||
|
|
||||||
|
| Trigger | Builds | Creates Release |
|
||||||
|
|---------|--------|-----------------|
|
||||||
|
| Push to `main` | Yes | No |
|
||||||
|
| Push tag `v*` | Yes | Yes |
|
||||||
|
| Manual dispatch | Yes | No |
|
||||||
|
|
||||||
|
### Platforms
|
||||||
|
|
||||||
|
All builds run in parallel:
|
||||||
|
|
||||||
|
- **Linux** (ubuntu-latest): AppImage, deb
|
||||||
|
- **Windows** (windows-latest): NSIS installer, portable exe
|
||||||
|
- **macOS** (macos-latest): Universal DMG (Intel + Apple Silicon)
|
||||||
|
|
||||||
|
### Creating a Release
|
||||||
|
|
||||||
|
1. Update version in `package.json`
|
||||||
|
2. Commit and push to `main`
|
||||||
|
3. Create and push a version tag:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git tag v2.0.1
|
||||||
|
git push origin v2.0.1
|
||||||
|
```
|
||||||
|
|
||||||
|
The workflow will:
|
||||||
|
1. Build all platforms in parallel
|
||||||
|
2. Upload artifacts to GitHub Release
|
||||||
|
3. Generate release notes automatically
|
||||||
|
|
||||||
|
### Build Artifacts
|
||||||
|
|
||||||
|
After each build, artifacts are available in the Actions tab for 90 days:
|
||||||
|
|
||||||
|
- `linux-builds`: `.AppImage`, `.deb`
|
||||||
|
- `windows-builds`: `.exe`
|
||||||
|
- `macos-builds`: `.dmg`, `.zip`, `latest-mac.yml`
|
||||||
|
|
||||||
|
### Local Development
|
||||||
|
|
||||||
|
Build locally for your platform:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm run build:linux
|
||||||
|
npm run build:win
|
||||||
|
npm run build:mac
|
||||||
|
```
|
||||||
|
|
||||||
|
Or build all platforms (requires appropriate OS):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm run build:all
|
||||||
|
```
|
||||||
89
.github/workflows/release.yml
vendored
Normal file
89
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,89 @@
|
|||||||
|
name: Build and Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
tags:
|
||||||
|
- 'v*'
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-linux:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: '22'
|
||||||
|
cache: 'npm'
|
||||||
|
- run: npm ci
|
||||||
|
- run: npx electron-builder --linux --publish never
|
||||||
|
- uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: linux-builds
|
||||||
|
path: |
|
||||||
|
dist/*.AppImage
|
||||||
|
dist/*.deb
|
||||||
|
|
||||||
|
build-windows:
|
||||||
|
runs-on: windows-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: '22'
|
||||||
|
cache: 'npm'
|
||||||
|
- run: npm ci
|
||||||
|
- run: npx electron-builder --win --publish never
|
||||||
|
- uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: windows-builds
|
||||||
|
path: |
|
||||||
|
dist/*.exe
|
||||||
|
|
||||||
|
build-macos:
|
||||||
|
runs-on: macos-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: '22'
|
||||||
|
cache: 'npm'
|
||||||
|
- run: npm ci
|
||||||
|
- run: npx electron-builder --mac --publish never
|
||||||
|
- uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: macos-builds
|
||||||
|
path: |
|
||||||
|
dist/*.dmg
|
||||||
|
dist/*.zip
|
||||||
|
dist/latest-mac.yml
|
||||||
|
|
||||||
|
release:
|
||||||
|
needs: [build-linux, build-windows, build-macos]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: startsWith(github.ref, 'refs/tags/v')
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Download all artifacts
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
path: artifacts
|
||||||
|
|
||||||
|
- name: Display structure of downloaded files
|
||||||
|
run: ls -R artifacts
|
||||||
|
|
||||||
|
- name: Create Release
|
||||||
|
uses: softprops/action-gh-release@v2
|
||||||
|
with:
|
||||||
|
files: |
|
||||||
|
artifacts/linux-builds/*
|
||||||
|
artifacts/windows-builds/*
|
||||||
|
artifacts/macos-builds/*
|
||||||
|
generate_release_notes: true
|
||||||
|
draft: false
|
||||||
|
prerelease: false
|
||||||
4914
package-lock.json
generated
Normal file
4914
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -94,15 +94,13 @@
|
|||||||
{
|
{
|
||||||
"target": "dmg",
|
"target": "dmg",
|
||||||
"arch": [
|
"arch": [
|
||||||
"x64",
|
"universal"
|
||||||
"arm64"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"target": "zip",
|
"target": "zip",
|
||||||
"arch": [
|
"arch": [
|
||||||
"x64",
|
"universal"
|
||||||
"arm64"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user