-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
235 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*" | ||
|
||
jobs: | ||
build_frontend: | ||
name: Build frontend | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
cache: "yarn" | ||
- run: yarn | ||
working-directory: skynet/frontend | ||
- run: yarn build | ||
working-directory: skynet/frontend | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: frontend | ||
path: skynet/frontend/dist | ||
|
||
build_skynet: | ||
needs: build_frontend | ||
name: Build skynet ${{ matrix.platform.os_name }} | ||
runs-on: ${{ matrix.platform.os }} | ||
strategy: | ||
matrix: | ||
platform: | ||
- os_name: linux-x86_64 | ||
os: ubuntu-20.04 | ||
target: x86_64-unknown-linux-gnu | ||
bin: skynet | ||
name: skynet-linux-x86_64.tar.gz | ||
- os_name: linux-i686 | ||
os: ubuntu-20.04 | ||
target: i686-unknown-linux-gnu | ||
bin: skynet | ||
name: skynet-linux-i686.tar.gz | ||
- os_name: linux-aarch64 | ||
os: ubuntu-20.04 | ||
target: aarch64-unknown-linux-gnu | ||
bin: skynet | ||
name: skynet-linux-aarch64.tar.gz | ||
- os_name: windows-x86_64 | ||
os: windows-latest | ||
target: x86_64-pc-windows-gnu | ||
bin: skynet.exe | ||
name: skynet-windows-x86_64.zip | ||
- os_name: macOS-x86_64 | ||
os: macOS-latest | ||
target: x86_64-apple-darwin | ||
bin: skynet | ||
name: skynet-darwin-x86_64.tar.gz | ||
- os_name: macOS-aarch64 | ||
os: macOS-latest | ||
target: aarch64-apple-darwin | ||
bin: skynet | ||
name: skynet-darwin-aarch64.tar.gz | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Cache cargo & target directories | ||
uses: Swatinem/rust-cache@v2 | ||
- name: Build binary | ||
uses: houseabsolute/actions-rust-cross@v0 | ||
with: | ||
command: "both" | ||
target: ${{ matrix.platform.target }} | ||
args: "--locked --release" | ||
strip: false | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: frontend | ||
path: release/skynet/assets | ||
- name: Package as archive | ||
shell: bash | ||
run: | | ||
cd release | ||
mkdir skynet/plugin | ||
cp ../target/${{ matrix.platform.target }}/release/${{ matrix.platform.bin }} skynet | ||
cp ../conf.yml skynet | ||
cp ../conf.schema.json skynet | ||
cp ../default.webp skynet | ||
if [[ "${{ matrix.platform.os }}" == "windows-latest" ]]; then | ||
7z a ../${{ matrix.platform.name }} skynet | ||
else | ||
tar czvf ../${{ matrix.platform.name }} skynet | ||
fi | ||
cd - | ||
- name: Publish release artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: skynet-${{ matrix.platform.os_name }} | ||
path: ${{ matrix.platform.name }} | ||
- name: Generate SHA-256 | ||
run: shasum -a 256 ${{ matrix.platform.name }} > ${{ matrix.platform.name }}.sha256 | ||
- name: Publish GitHub release | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
draft: true | ||
files: ${{ matrix.platform.name }}* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# yaml-language-server: $schema=conf.schema.json | ||
database: | ||
dsn: "sqlite://../data.db?mode=rwc" # database dsn, support sqlite, mysql, postgresql | ||
|
||
redis: | ||
dsn: "redis://127.0.0.1:6379/0" # redis dsn | ||
|
||
session: | ||
key: "Ckm7cYj0XDaIkGQeXYun7fuduCT8V5dMwYzMAz2mb5nlj3FTAgLYp5MstHh18PW8" # session sign key, at least 64 in length | ||
prefix: "session_" # prefix in redis, please prevent glob pattern keywords like ? and * | ||
cookie: "SESSIONID" # session cookie name | ||
expire: 3600 # default expire time seconds | ||
remember: 5184000 # remember expire time seconds | ||
|
||
listen: | ||
address: "localhost:8080" # listen address | ||
worker: 0 # web workers, 0 for cores | ||
ssl: false # enable ssl | ||
ssl_cert: "" # ssl certificate path(.crt) | ||
ssl_key: "" # ssl key path(.key) | ||
|
||
header: | ||
csp: "default-src 'none'; script-src 'self' 'unsafe-eval' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; connect-src 'self'; base-uri 'self'" # Content Security Policy, https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP | ||
|
||
proxy: | ||
enable: false # if skynet is behind proxy, enable to get correct ip | ||
header: "X-Forwarded-For" # ip header set by proxy server | ||
trusted: "" # trusted proxy address, client ip will be the first untrusted one in header, seperated by , | ||
|
||
recaptcha: | ||
enable: false # if enable recaptcha | ||
url: "https://www.recaptcha.net" # verify url | ||
sitekey: "" # recaptcha sitekey | ||
secret: "" # recaptcha secret | ||
timeout: 10 # connect timeout seconds | ||
|
||
csrf: | ||
prefix: "csrf_" # redis prefix | ||
timeout: 10 # timeout second | ||
|
||
avatar: "default.webp" # default avatar | ||
lang: "en-US" # default language |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.