Skip to content

Commit

Permalink
Merge branch 'main' into deploy/testnet
Browse files Browse the repository at this point in the history
  • Loading branch information
IPadawans committed Jan 10, 2024
2 parents a89bdd4 + 9a97894 commit c9ea06e
Show file tree
Hide file tree
Showing 7 changed files with 161 additions and 25 deletions.
24 changes: 24 additions & 0 deletions .github/config/changelog.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"categories": [
{
"title": "## 🚀 Features",
"labels": ["feature"]
},
{
"title": "## 🐛 Fixes",
"labels": ["fix"]
},
{
"title": "## 🧪 Tests",
"labels": ["test"]
},
{
"title": "## 📓 Architecture Decision Records",
"labels": ["adr"]
},
{
"title": "## 💬 Other",
"labels": ["other"]
}
]
}
34 changes: 34 additions & 0 deletions .github/templates/build_tessellation/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Build tessellation dependencies

inputs:
GITHUB_TOKEN:
required: true

runs:
using: "composite"
steps:
- name: Get tessellation version to build
shell: bash
run: |
echo "TESSELLATION_VERSION=v$(cat metagraph/project/Dependencies.scala | grep -E "tessellation = \"(.*)" | grep -o "\".*\"" | grep -Eo "[^\"]*")" >> $GITHUB_ENV
- name: Clone and generate Tessellation dependencies
env:
GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }}
shell: bash
run: |
echo "TESSELLATION_VERSION=$TESSELLATION_VERSION"
mkdir .github/dependencies
cd .github/dependencies
git clone https://github.com/Constellation-Labs/tessellation.git
cd tessellation
git checkout $TESSELLATION_VERSION
sbt clean shared/publishM2
sbt clean kernel/publishM2
sbt clean keytool/publishM2
sbt clean sdk/publishM2
sbt clean dagL1/publishM2
sbt clean currencyL0/publishM2
sbt clean currencyL1/publishM2
27 changes: 3 additions & 24 deletions .github/templates/deploy/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,31 +78,10 @@ runs:
echo "Bucket '$BUCKET_NAME' already exists."
fi
- name: Get tessellation version to build
shell: bash
run: |
echo "TESSELLATION_VERSION=v$(cat metagraph/project/Dependencies.scala | grep -E "tessellation = \"(.*)" | grep -o "\".*\"" | grep -Eo "[^\"]*")" >> $GITHUB_ENV
- name: Clone and generate Tessellation dependencies
env:
- name: Build tessellation dependencies
with:
GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }}
shell: bash
run: |
echo "TESSELLATION_VERSION=$TESSELLATION_VERSION"
mkdir .github/dependencies
cd .github/dependencies
git clone https://github.com/Constellation-Labs/tessellation.git
cd tessellation
git checkout $TESSELLATION_VERSION
sbt clean shared/publishM2
sbt clean kernel/publishM2
sbt clean keytool/publishM2
sbt clean sdk/publishM2
sbt clean dagL1/publishM2
sbt clean currencyL0/publishM2
sbt clean currencyL1/publishM2
uses: "./.github/templates/build_tessellation"

- name: Generate Metagraph JARS
env:
Expand Down
33 changes: 33 additions & 0 deletions .github/templates/setup_java_and_scala/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Setup Java and Scala

inputs:
JAVA_VERSION:
required: true
GITHUB_TOKEN:
required: true

runs:
using: "composite"
steps:
- name: Setup Java and scala
uses: olafurpg/setup-scala@v13
with:
java-version: ${{ inputs.JAVA_VERSION }}

- name: Cache for sbt & coursier ♨️
uses: coursier/cache-action@v6
id: coursier-cache

- name: Build tessellation dependencies
with:
GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }}
uses: "./.github/templates/build_tessellation"

- name: Fetch Dependencies
shell: bash
if: steps.coursier-cache.outputs.cache-hit-coursier != 'true'
env:
GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }}
run: |
cd metagraph
sbt +update
65 changes: 65 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
on:
push:
tags:
- 'v*'

name: Create Release

jobs:
build:
if: startsWith(github.ref, 'refs/tags/')
name: Create Release
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3

- name: Check if project version is release version
run: test "v$(cut -d \" -f 2 metagraph/version.sbt)" = "${{ github.ref_name }}"

- name: Build Changelog
id: build_changelog
uses: mikepenz/[email protected]
with:
configuration: ".github/config/changelog.json"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- uses: little-core-labs/[email protected]
id: tagName
with:
tagRegex: "v(.*)"
tagRegexGroup: 1

- name: Setup Java and scala
with:
JAVA_VERSION: [email protected]
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: "./.github/templates/setup_java_and_scala"

- name: Test and assembly 🚀
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd metagraph
sbt 'test;currencyL0/assembly;currencyL1/assembly;dataL1/assembly'
- name: Copy dependencies
run: |
cd metagraph
cp ./modules/l0/target/scala-2.13/dor_metagraph-currency-l0-assembly-${{ steps.tagName.outputs.tag }}.jar ./metagraph-l0.jar
cp ./modules/l1/target/scala-2.13/dor_metagraph-currency-l1-assembly-${{ steps.tagName.outputs.tag }}.jar ./currency-l1.jar
cp ./modules/data_l1/target/scala-2.13/dor_metagraph-data_l1-assembly-${{ steps.tagName.outputs.tag }}.jar ./data-l1.jar
- name: Upload release assets
uses: softprops/action-gh-release@v1
with:
name: DOR Metagraph Release ${{ steps.tagName.outputs.tag }}
draft: false
prerelease: false
body: ${{ steps.build_changelog.outputs.changelog }}
files: |
./metagraph/metagraph-l0.jar
./metagraph/currency-l1.jar
./metagraph/data-l1.jar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion metagraph/project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import sbt._
object Dependencies {

object V {
val tessellation = "2.2.0"
val tessellation = "2.1.1"
val decline = "2.4.1"
}
def tessellation(artifact: String): ModuleID = "org.constellation" %% s"tessellation-$artifact" % V.tessellation
Expand Down
1 change: 1 addition & 0 deletions metagraph/version.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ThisBuild / version := "1.0.0"

0 comments on commit c9ea06e

Please sign in to comment.