Skip to content

Commit

Permalink
.github: Add workflow for generating static assets for release (#98)
Browse files Browse the repository at this point in the history
  • Loading branch information
hjpotter92 authored Feb 28, 2025
1 parent c120fc1 commit 388eaa3
Show file tree
Hide file tree
Showing 4 changed files with 111 additions and 1 deletion.
14 changes: 14 additions & 0 deletions .editorconfig
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
23 changes: 23 additions & 0 deletions .github/dependabot.yaml
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
69 changes: 69 additions & 0 deletions .github/workflows/release.yaml
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
6 changes: 5 additions & 1 deletion ui/.eslintrc.json
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"
}
}

0 comments on commit 388eaa3

Please sign in to comment.