-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #396 from tablelandnetwork/jsign/testnetmainnetsplit
First Ship meta PR
- Loading branch information
Showing
97 changed files
with
3,596 additions
and
2,363 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 |
---|---|---|
@@ -0,0 +1,107 @@ | ||
name: Generate binaries | ||
on: | ||
release: | ||
types: | ||
- created | ||
jobs: | ||
binaries: | ||
strategy: | ||
matrix: | ||
include: | ||
- os: ubuntu-latest | ||
asset_name: api-linux-amd64.tar.gz | ||
compress_cmd: tar -czvf | ||
build_cmd: docker run -v $PWD:/data golang:1.19 bash -c "cd /data && go build ./cmd/api" | ||
- os: windows-latest | ||
asset_name: api-windows-amd64.zip | ||
compress_cmd: tar.exe -a -c -f | ||
build_cmd: go build -o api ./cmd/api | ||
- os: macos-latest | ||
asset_name: api-darwin-amd64.tar.gz | ||
compress_cmd: tar -czvf | ||
build_cmd: go build -o api ./cmd/api | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
- name: Install Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: v1.19.x | ||
- name: Build binary | ||
run: ${{ matrix.build_cmd }} | ||
- name: Pack output | ||
run: ${{ matrix.compress_cmd }} ${{ matrix.asset_name }} api | ||
- name: Upload binary | ||
uses: svenstaro/upload-release-action@v2 | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: ${{ matrix.asset_name }} | ||
asset_name: ${{ matrix.asset_name }} | ||
tag: ${{ github.ref_name }} | ||
overwrite: true | ||
docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Build and push | ||
uses: docker/build-push-action@v3 | ||
with: | ||
file: ./cmd/api/Dockerfile | ||
push: true | ||
tags: textile/tableland:latest,textile/tableland:${{ github.ref_name }} | ||
platforms: linux/amd64, linux/arm64 | ||
js-release: | ||
runs-on: ubuntu-latest | ||
if: ${{ success() }} | ||
needs: [binaries] | ||
steps: | ||
- run: echo "release_version ${{ github.ref_name }}" | ||
|
||
- name: PR to publish this release via the npm package | ||
uses: actions/github-script@v6 | ||
with: | ||
github-token: ${{ secrets.TEXTILEIO_MACHINE_ACCESS_TOKEN }} | ||
script: | | ||
// This triggers the release-pr workflow in the js-validator repo | ||
// which will create a pull request in that repo to update the binaries | ||
// on npm with this release | ||
try { | ||
const ownerOrg = 'tablelandnetwork'; | ||
// if the tag/release has a preceeding "v" we want to remove | ||
// it and match standard symantics in the js ecosystem | ||
let version = '${{ github.ref_name }}'; | ||
if (/^v[0-9]/.test(version)) { | ||
version = version.slice(1); | ||
} | ||
const options = { | ||
owner: ownerOrg, | ||
repo: 'js-validator', | ||
workflow_id: 'validator-update-pr.yml', | ||
ref: 'main', | ||
inputs: { | ||
release_version: version | ||
} | ||
}; | ||
console.log(options); | ||
const response = await github.rest.actions.createWorkflowDispatch(options); | ||
if (response.status !== 204) { | ||
core.setFailed(`create workflow_dispatch received status code ${response.status}`); | ||
} | ||
} catch(err) { | ||
console.log(err); | ||
core.setFailed(err.message); | ||
} |
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 |
---|---|---|
|
@@ -23,3 +23,4 @@ evm_history.db | |
# Project | ||
.env* | ||
*.ignore | ||
tableland-openapi-spec.yaml |
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 |
---|---|---|
|
@@ -14,7 +14,6 @@ GOVVV=go run github.com/ahmetb/[email protected] | |
GOVVV_FLAGS=$(shell $(GOVVV) -flags -version $(BIN_VERSION) -pkg $(shell go list ./buildinfo)) | ||
|
||
# Code generation | ||
|
||
ethereum: ethereum-testcontroller ethereum-testerc721 ethereum-testerc721a | ||
go run github.com/ethereum/go-ethereum/cmd/[email protected] --abi ./pkg/tables/impl/ethereum/abi.json --pkg ethereum --type Contract --out pkg/tables/impl/ethereum/contract.go --bin pkg/tables/impl/ethereum/bytecode.bin | ||
.PHONY: ethereum | ||
|
@@ -52,7 +51,6 @@ generate-history-db: | |
rm ${EVM_EVENTS_TARGET} | ||
|
||
# Build | ||
|
||
build-api: | ||
go build -ldflags="${GOVVV_FLAGS}" ./cmd/api | ||
.PHONY: build-api | ||
|
@@ -70,7 +68,6 @@ image: | |
.PHONY: image | ||
|
||
# Test | ||
|
||
test: | ||
go test ./... -short -race | ||
.PHONY: test | ||
|
@@ -79,7 +76,21 @@ test-replayhistory: | |
go test ./pkg/eventprocessor/impl -run=TestReplayProductionHistory -race | ||
|
||
# Lint | ||
|
||
lint: | ||
go run github.com/golangci/golangci-lint/cmd/[email protected] run | ||
.PHONYY: lint | ||
.PHONY: lint | ||
|
||
# OpenAPI | ||
SPEC_URL=https://raw.githubusercontent.com/tablelandnetwork/docs/main/specs/validator/tableland-openapi-spec.yaml | ||
APIV1=${PWD}/internal/router/controllers/apiv1 | ||
gen-api-v1: | ||
mkdir -p ${APIV1} | ||
curl -s ${SPEC_URL} > ${APIV1}/tableland-openapi-spec.yaml | ||
docker run -w /gen -e GEN_DIR=/gen -v ${APIV1}:/gen swaggerapi/swagger-codegen-cli-v3:3.0.36 \ | ||
generate --lang go-server -o /gen -i tableland-openapi-spec.yaml --additional-properties=packageName=apiv1 | ||
sudo chown -R ${USER} ${APIV1} | ||
cd ${APIV1} && \ | ||
mv go/* . && \ | ||
rm -rf go main.go Dockerfile README.md api .swagger-codegen .swagger-codegen-ignore *.yaml | ||
sed -i 's/\*OneOfTableAttributesValue/interface{}/' internal/router/controllers/apiv1/model_table_attributes.go | ||
.PHONY: gen-api-v1 |
Oops, something went wrong.