Skip to content

Commit

Permalink
WIP: Rewrite
Browse files Browse the repository at this point in the history
  • Loading branch information
julienvincent committed Sep 4, 2024
1 parent c785b59 commit fea5df0
Show file tree
Hide file tree
Showing 97 changed files with 2,552 additions and 2,552 deletions.
2 changes: 2 additions & 0 deletions .cljfmt.edn
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{:remove-multiple-non-indenting-spaces? true
:sort-ns-references? true}
53 changes: 53 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Build
on: [push]

jobs:
build-and-publish:
runs-on: ubuntu-latest

steps:
- name: Checkout git repo
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup Git
run: |
git config --global user.email "[email protected]"
git config --global user.name "Kmono CI"
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
cache: 'maven'
cache-dependency-path: '**/deps.edn'

- uses: extractions/setup-just@v1

- uses: DeLaGuardo/[email protected]
with:
cli: latest

- name: Preload dependencies
run: |
just cli cp -P ':*/*' > /dev/null
- name: Build
run: |
just build
- name: Test
run: |
just cli run -M ':*/test'
# - name: Release
# env:
# CLOJARS_USERNAME: infrastructure-kepler16-com
# CLOJARS_PASSWORD: ${{ secrets.CLOJARS_PASSWORD }}
# run: |
# just release \
# ":snapshot?" ${{ github.ref_name != 'master' }} \
# ":create-tags?" ${{ github.ref_name == 'master' }}

137 changes: 88 additions & 49 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,62 +1,101 @@
name: Publish kmono 👘
on: [push]
name: Release

on:
push:
pull_request:
workflow_dispatch:

jobs:
build-and-publish:
runs-on: ubuntu-latest
build-cli:
strategy:
matrix:
include:
- arch: linux-amd64
runs-on: ubuntu-latest
- arch: linux-arm64
runs-on: arm-c8
- arch: macos-amd64
runs-on: macos-latest
- arch: macos-arm64
runs-on: macos-latest-xlarge

runs-on: ${{ matrix.runs-on }}
steps:
- name: Checkout git repo
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Checkout git repo
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Cache clojure dependencies
uses: actions/cache@v3
with:
path: |
~/.m2/repository
~/.gitlibs
~/.deps.clj
key: cljdeps-${{ hashFiles('deps.edn') }}
restore-keys: cljdeps-

- uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '17'
- name: Fetch Tags
run: git fetch --tags origin

- uses: extractions/setup-just@v1
- name: Setup Git
run: |
git config --global user.email "[email protected]"
git config --global user.name "Kmono CI"
- uses: DeLaGuardo/[email protected]
with:
cli: latest
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
cache: 'maven'
cache-dependency-path: '**/deps.edn'

- uses: graalvm/setup-graalvm@v1
with:
java-version: '21'
distribution: 'graalvm'
github-token: ${{ secrets.GITHUB_TOKEN }}

- uses: extractions/setup-just@v1
- uses: DeLaGuardo/[email protected]
with:
cli: latest

- name: Preload dependencies
run: |
just cli cp -P ':*/*' > /dev/null
- name: Build
run: |
just build
just build-cli
- uses: s4u/[email protected]
- name: Pack binary
run: |
tar -czf kmono-${{ matrix.arch }}.tar.gz -C ./target/bin kmono
- uses: actions/upload-artifact@v3
with:
name: binaries
if-no-files-found: error
path: kmono-${{ matrix.arch }}.tar.gz

release:
runs-on: ubuntu-latest
needs: [build]
if: ${{ github.ref_type == 'tag' && startsWith(github.ref_name, 'v') }}
steps:
- uses: actions/checkout@v3

- name: Download Binary Artifacts
uses: actions/download-artifact@v2
with:
githubServer: false
servers: |
[{"id": "github-kepler",
"username": "${{ secrets.ORG_GITHUB_ACTOR }}",
"password": "${{ secrets.ORG_GITHUB_TOKEN }}"},
{"id": "github-kepler-kmono",
"username": "${{ github.actor }}",
"password": "${{ secrets.GITHUB_TOKEN }}"}]
- name: Test
run: |
just test
name: binaries
path: bin

- name: Build
- name: Calculate checksums
run: |
just build ":snapshot?" ${{ github.ref_name != 'master' }}
for file in bin/*; do
shasum -a 256 "$file" >> checksums.txt
done
- name: Release
env:
CLOJARS_USERNAME: infrastructure-kepler16-com
CLOJARS_PASSWORD: ${{ secrets.CLOJARS_PASSWORD }}
run: |
just release \
":snapshot?" ${{ github.ref_name != 'master' }} \
":create-tags?" ${{ github.ref_name == 'master' }}
mv checksums.txt bin/checksums.txt
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
bin/*
121 changes: 0 additions & 121 deletions .github/workflows/release_binary.yml

This file was deleted.

41 changes: 11 additions & 30 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,32 +1,13 @@
# resources/ccloud.properties
.cache
/.clj-kondo
!/.clj-kondo/config.edn
.cpcache/
.kbuild/
.metabuild/
.nrepl-port
/telepresence.log
/classes/
target/
# /resources/zeus-service-account.json
/.log/
node_modules
config-override.edn
*.log.[0-9][0-9][0-9]
*.log
/resources/auth/
/.idea/
.tool-versions
*.iml
/.calva/
/.DS_Store/
/logs/
/data/
/deps.local.edn
/local
.idea
.vscode
.DS_Store

.cpcache
.lsp
.portal
.clj-kondo
.nrepl-port
.test-repos
deps.local.edn

!.github
bin
local
target
Loading

0 comments on commit fea5df0

Please sign in to comment.