Skip to content

Commit

Permalink
add justfile for SimpleBase
Browse files Browse the repository at this point in the history
  • Loading branch information
TheButlah committed Jan 7, 2025
1 parent cf9bff0 commit e2a954a
Show file tree
Hide file tree
Showing 7 changed files with 88 additions and 22 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: CI/CD
on:
workflow_call:
push:
branches:
- main
pull_request:
workflow_dispatch:

# https://stackoverflow.com/a/72408109
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
check-inputs:
runs-on: ubuntu-24.11
outputs:
is-default-branch: ${{ steps.set-is-default-branch.outputs.CI_IS_DEFAULT_BRANCH }}

steps:
- name: Set is-default-branch
id: set-is-default-branch
run: |
CI_IS_DEFAULT_BRANCH="${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}"
echo "CI_IS_DEFAULT_BRANCH=${CI_IS_DEFAULT_BRANCH}" >> $GITHUB_OUTPUT
echo "CI_IS_DEFAULT_BRANCH=${CI_IS_DEFAULT_BRANCH}" >> $GITHUB_ENV
echo "CI_IS_DEFAULT_BRANCH=${CI_IS_DEFAULT_BRANCH}"
nix:
name: Nix
needs: check-inputs
uses: ./.github/workflows/nix.yaml
secrets: inherit

csharp:
name: C#
needs: check-inputs
uses: ./.github/workflows/csharp.yaml
14 changes: 14 additions & 0 deletions .github/workflows/csharp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: C#
on:
workflow_dispatch:
workflow_call:

jobs:
build_upm:
name: Build Unity Packages
runs-on: ubuntu-24.11
steps:
- uses: actions/checkout@v4
- name: Build
runs: |
just build
Empty file removed .github/workflows/upm.yaml
Empty file.
22 changes: 0 additions & 22 deletions justfile

This file was deleted.

3 changes: 3 additions & 0 deletions msbuild/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Packages from MSBuild

These packages are built from msbuild, and turned into Unity Packages.
25 changes: 25 additions & 0 deletions msbuild/SimpleBase/justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
git_repo := "https://github.com/ssg/SimpleBase.git"
git_ref := "4.0.2"
dll_name := "SimpleBase.dll"
out_dir := invocation_directory()

working_dir := `mktemp -d`
repo_dir := working_dir / "repo"
dotnet_artifact_dir := working_dir / "dotnet_artifacts"

default:
just --list

# Clean build outputs
clean:
dotnet clean {{repo_dir}} || true
rm -rf {{repo_dir}}/**/bin {{repo_dir}}/**/obj

clone:
git clone --single-branch --branch {{git_ref}} {{git_repo}} {{repo_dir}}

restore:
dotnet restore {{repo_dir}} --artifacts-path {{dotnet_artifact_dir}}

build: restore
dotnet build --configuration Release {{repo_dir}} -o {{dotnet_artifact_dir}}
7 changes: 7 additions & 0 deletions msbuild/SimpleBase/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "org.basisvr.simplebase",
"version": "4.0.2",
"displayName": "SimpleBase",
"description": "Base16, Base32, Base58, Base85 encoding/decoding library",
"documentationUrl": "https://github.com/ssg/SimpleBase"
}

0 comments on commit e2a954a

Please sign in to comment.