From 6b9e2adf4f9fe2d9c1d7f5c559de024437b8fed1 Mon Sep 17 00:00:00 2001 From: Thomas E Lackey Date: Tue, 21 Nov 2023 22:09:39 -0600 Subject: [PATCH] Add .gitea workflows --- .gitea/workflows/publish.yaml | 36 ++++++++++++++++++++++++++++ .gitea/workflows/test.yml | 45 +++++++++++++++++++++++++++++++++++ package.json | 2 +- yarn.lock | 8 +++---- 4 files changed, 86 insertions(+), 5 deletions(-) create mode 100644 .gitea/workflows/publish.yaml create mode 100644 .gitea/workflows/test.yml diff --git a/.gitea/workflows/publish.yaml b/.gitea/workflows/publish.yaml new file mode 100644 index 0000000..88a9807 --- /dev/null +++ b/.gitea/workflows/publish.yaml @@ -0,0 +1,36 @@ +name: Publish npm package to gitea +on: + release: + types: [published] +jobs: + npm_publish: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [ 18.x ] + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Download yarn + run: | + curl -fsSL -o /usr/local/bin/yarn https://github.com/yarnpkg/yarn/releases/download/v1.22.21/yarn-1.22.21.js + chmod +x /usr/local/bin/yarn + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + - run: yarn + - name: Run yarn build + run: | + yarn build + - name: Configure git.vdb.to npm registry + run: | + npm config set registry https://git.vdb.to/api/packages/cerc-io/npm/ + - name: Authenticate to git.vdb.to registry + run: | + npm config set -- '//git.vdb.to/api/packages/cerc-io/npm/:_authToken' "${{ secrets.CICD_PUBLISH_TOKEN }}" + - name: npm publish + run: | + npm publish diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml new file mode 100644 index 0000000..6dc7a5c --- /dev/null +++ b/.gitea/workflows/test.yml @@ -0,0 +1,45 @@ +name: Tests +on: + pull_request: + branches: + - '*' + push: + branches: + - main + - release/** + +env: + DOCKER_HOST: unix:///var/run/dind.sock + +jobs: + sdk_tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Checkout laconicd + uses: actions/checkout@v3 + with: + path: "./laconicd/" + repository: cerc-io/laconicd + fetch-depth: 0 + ref: main + - name: Environment + run: ls -tlh && env + - name: Start dockerd + run: | + dockerd -H $DOCKER_HOST --userland-proxy=false & + sleep 5 + - name: build registry-cli container + run: docker build -t cerc/laconic-registry-cli:local-test --build-arg CERC_NPM_URL=https://git.vdb.to/api/packages/cerc-io/npm/ --build-arg CERC_NPM_AUTH_TOKEN="${{ secrets.CICD_PUBLISH_TOKEN }}" . + - name: build containers scripts + working-directory: laconicd/tests/sdk_tests + run: ./build-laconicd-container.sh + - name: start laconicd container + working-directory: laconicd/tests/sdk_tests + run: docker compose up laconicd -d + + - name: Run registry-cli demo commands in registry-cli container + run : ls -tla + - name: stop containers + working-directory: laconicd/tests/sdk_tests + run: docker compose down diff --git a/package.json b/package.json index 996a1d5..fc97e29 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ }, "dependencies": { "fs-extra": "^10.1.0", - "@cerc-io/laconic-sdk": "0.1.6", + "@cerc-io/laconic-sdk": "0.1.9", "js-yaml": "^3.14.1", "lodash": "^4.17.21", "lodash-clean": "^2.2.3", diff --git a/yarn.lock b/yarn.lock index 1098c7b..575647f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,10 +2,10 @@ # yarn lockfile v1 -"@cerc-io/laconic-sdk@0.1.6": - version "0.1.6" - resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Flaconic-sdk/-/0.1.6/laconic-sdk-0.1.6.tgz#2c4e678800467e7c92c3198fe332401d2ab395ce" - integrity sha512-o7G/QpfmNTFkmKQEuCf8mdZc8AePRMQ9T5kLqW30aHi9vzwA5rI7I6dXmPLzGYwdMWUdeeQcePOQhwD2qccryw== +"@cerc-io/laconic-sdk@0.1.9": + version "0.1.9" + resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Flaconic-sdk/-/0.1.9/laconic-sdk-0.1.9.tgz#cf11d20a22c75fd61126640824d27d687f925151" + integrity sha512-LlOBZ39cYalvu9YZBpf5KUkgJJDlsuUhAaBReedwVV5O7zwy+3zRaM4HkX+3saG3a4qR8VfYWEeS5GqF9b6Ixw== dependencies: "@cosmjs/amino" "^0.28.1" "@cosmjs/crypto" "^0.28.1"