-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update logger. Update build process to use Generate. Rearrange code.
- Loading branch information
1 parent
0eb8754
commit 72a4078
Showing
24 changed files
with
1,387 additions
and
936 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 |
---|---|---|
@@ -1,58 +1,50 @@ | ||
name: Create Archive on Tag | ||
name: Create release | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
- "v*.*.*" | ||
|
||
jobs: | ||
build_and_archive: | ||
create_release: | ||
name: build / push | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Node.js 21 | ||
- name: Set up Node.js 22 (LTS) | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '21' | ||
node-version: '22' | ||
|
||
- name: Enable Corepack | ||
working-directory: client | ||
run: corepack enable | ||
|
||
- name: Install dependencies | ||
working-directory: client | ||
run: yarn install | ||
|
||
- name: Build project | ||
working-directory: client | ||
run: yarn build | ||
|
||
- name: Create archives of dist folder | ||
- name: Build the artifacts | ||
working-directory: client | ||
run: | | ||
zip -r dist.zip dist | ||
tar -czvf dist.tar.gz dist | ||
corepack enable | ||
yarn install | ||
yarn build | ||
- name: Upload archives as artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: dist.zip | ||
path: client/dist.zip | ||
|
||
- name: Upload tar.gz as artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: dist.tar.gz | ||
path: client/dist.tar.gz | ||
- name: Create web client artifacts | ||
working-directory: client/dist | ||
run: | | ||
tar -czf ../../client-assets.tar.gz * | ||
zip -r ../../client-assets.zip * | ||
- name: Upload dist.zip and dist.tar.gz to the release | ||
uses: svenstaro/upload-release-action@v2 | ||
- name: Determine if prerelease | ||
run: | | ||
TAG="${GITHUB_REF##*/}" | ||
if [[ "$TAG" == *-* ]]; then | ||
echo "PRERELEASE=true" >> $GITHUB_ENV | ||
else | ||
echo "PRERELEASE=false" >> $GITHUB_ENV | ||
fi | ||
- name: Release | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
file: client/dist.* | ||
file_glob: true | ||
tag: ${{ github.ref_name }} | ||
release_name: ${{ github.ref_name }} | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
prerelease: ${{ env.PRERELEASE }} | ||
files: | | ||
client-assets.tar.gz | ||
client-assets.zip |
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,59 @@ | ||
package web | ||
|
||
import ( | ||
"io/fs" | ||
"os" | ||
"path/filepath" | ||
) | ||
|
||
var clientAssetsFS fs.FS | ||
var swaggerAssetsFS fs.FS | ||
|
||
// SetClientAssetsFS sets the global web client assets filesystem. | ||
func SetClientAssetsFS(f fs.FS) { | ||
clientAssetsFS = f | ||
} | ||
|
||
// SetSwaggerUIAssetsFS sets the filesystem containing the swagger UI assets. | ||
func SetSwaggerUIAssetsFS(f fs.FS) { | ||
swaggerAssetsFS = f | ||
} | ||
|
||
// GetClientAssetsFS returns web client assets. | ||
func GetClientAssetsFS() fs.FS { | ||
if clientAssetsFS != nil { | ||
return clientAssetsFS | ||
} | ||
// If client assets were not set, we are in the development environment. | ||
path := filepath.Join("client", "dist") | ||
_, err := os.Stat(path) | ||
if os.IsNotExist(err) { | ||
panic(path + " assets are not available") | ||
} | ||
SetClientAssetsFS(os.DirFS(path)) | ||
return clientAssetsFS | ||
} | ||
|
||
// GetSwaggerUIAssetsFS returns web assets for swagger-ui. | ||
func GetSwaggerUIAssetsFS() (fs.FS, error) { | ||
if swaggerAssetsFS != nil { | ||
return swaggerAssetsFS, nil | ||
} | ||
// If client assets were not set, we are in the development environment. | ||
path := filepath.Join("swagger-ui") | ||
_, err := os.Stat(path) | ||
if err != nil { | ||
return nil, err | ||
} | ||
SetSwaggerUIAssetsFS(os.DirFS(path)) | ||
return swaggerAssetsFS, nil | ||
} | ||
|
||
// MustSubFS returns fs by subpath. | ||
func MustSubFS(orig fs.FS, path string) fs.FS { | ||
sub, err := fs.Sub(orig, path) | ||
if err != nil { | ||
panic(err) | ||
} | ||
return sub | ||
} |
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,13 @@ | ||
//go:build ignore | ||
|
||
package main | ||
|
||
import ( | ||
"github.com/launchrctl/launchr" | ||
|
||
_ "github.com/launchrctl/web" | ||
) | ||
|
||
func main() { | ||
launchr.GenAndExit() | ||
} |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.