-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
.github: Add workflow for generating static assets for release (#98)
- Loading branch information
1 parent
c120fc1
commit 388eaa3
Showing
4 changed files
with
111 additions
and
1 deletion.
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,14 @@ | ||
# editorconfig.org | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[Dockerfile*] | ||
indent_style = tab | ||
indent_size = 8 |
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,23 @@ | ||
version: 2 | ||
|
||
updates: | ||
- package-ecosystem: github-actions | ||
directory: / | ||
schedule: | ||
interval: daily | ||
|
||
- package-ecosystem: npm | ||
directory: /ui/ | ||
versioning-strategy: increase | ||
schedule: | ||
interval: daily | ||
|
||
- package-ecosystem: pip | ||
directory: / | ||
schedule: | ||
interval: daily | ||
|
||
- package-ecosystem: docker | ||
directory: /docker/ | ||
schedule: | ||
interval: monthly |
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,69 @@ | ||
name: Create release draft | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- "v*" | ||
pull_request: | ||
# types: [closed] | ||
branches: | ||
- main | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
# if: ${{ github.event.pull_request.merged }} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18 | ||
cache: npm | ||
cache-dependency-path: ui/package-lock.json | ||
|
||
- name: Build project | ||
env: | ||
"NEXT_PUBLIC_DEV": "false" | ||
run: | | ||
mkdir -p releases/ | ||
cur_dir="$(pwd)" | ||
cd ui/ | ||
npm ci | ||
npm run build | ||
dist_dir="../nodes/web/static/" | ||
if ! [ test -d "${dist_dir}" ]; | ||
then | ||
dist_dir="./.next/"; | ||
fi | ||
cd "$dist_dir" | ||
zip -DTr9q "${cur_dir}/releases/dist.zip" ./ | ||
cd - | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: release-artifacts | ||
path: releases/ | ||
|
||
- uses: actions-ecosystem/action-regex-match@v2 | ||
id: match-tag | ||
with: | ||
text: ${{ github.event.workflow_run.head_branch }} | ||
regex: '^v([0-9]+\.\d+\.\d+)$' | ||
|
||
- name: Create release | ||
if: ${{ steps.match-tag.outputs.match != '' }} | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
files: | | ||
dist.zip | ||
tag_name: v${{ steps.current_version.outputs.version }} | ||
target_commitish: ${{ github.event.pull_request.base.ref }} | ||
make_latest: ${{ github.event.pull_request.base.ref == 'main' }} | ||
draft: true | ||
prerelease: false | ||
generate_release_notes: true |
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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
{ | ||
"extends": ["next/core-web-vitals", "next/typescript"] | ||
"extends": ["next/core-web-vitals", "next/typescript"], | ||
"rules": { | ||
"@typescript-eslint/no-unused-vars": "off", | ||
"@typescript-eslint/no-explicit-any": "off" | ||
} | ||
} |