From 88e41d6fdcc304d5178bb5be682f8461cf98076c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D0=B5=D0=BC?= Date: Mon, 14 Feb 2022 19:52:41 +0300 Subject: [PATCH] Erlang build (#9) * TD-126: Add erlang builds * mb add release? * changed to master * fixed * fixed checkout --- .github/workflows/release-erlang.yaml | 83 +++++++++++++++++++++++++++ .github/workflows/release.yml | 29 ++++++++++ 2 files changed, 112 insertions(+) create mode 100644 .github/workflows/release-erlang.yaml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release-erlang.yaml b/.github/workflows/release-erlang.yaml new file mode 100644 index 0000000..6c59017 --- /dev/null +++ b/.github/workflows/release-erlang.yaml @@ -0,0 +1,83 @@ +name: Release Erlang Libraries +on: + push: + branches: [master] + pull_request: + branches: ['**'] + +env: + NODEJS_VERSION: '16' + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + with: + submodules: recursive + + - name: Setup swagger-codegen + uses: valitydev/action-setup-swagger-codegen@v0.0.1 + with: + codegen-version: "2.4.25" + generator-version: "1.0.1" + + - name: Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: ${{ env.NODEJS_VERSION }} + cache: npm + + - name: Install deps + run: npm install + + - name: Bundle spec and build docsite + run: npm run patch + + - name: Generate stubs + run: | + mkdir -p out + echo "Generate wallet stubs" + swagger-codegen generate -l vality-erlang-client -i dist/api/wallet/swagger.json -o out/erlang-client-wallet --additional-properties packageName=swag_client_wallet + swagger-codegen generate -l vality-erlang-server -i dist/api/wallet/swagger.json -o out/erlang-server-wallet --additional-properties packageName=swag_server_wallet + echo "Generate payres stubs" + swagger-codegen generate -l vality-erlang-client -i dist/api/payres/swagger.json -o out/erlang-client-payres --additional-properties packageName=swag_client_payres + swagger-codegen generate -l vality-erlang-server -i dist/api/payres/swagger.json -o out/erlang-server-payres --additional-properties packageName=swag_server_payres + +# + + - name: Deploy erlang-client-wallet artifact to release branch + if: ${{ github.event_name == 'push' }} + uses: JamesIves/github-pages-deploy-action@v4.2.2 + with: + branch: release/erlang/wallet-client/master + folder: out/erlang-client-wallet + commit-message: Release ${{ github.repository }}@${{ github.sha }} + + - name: Deploy erlang-server-wallet artifact to release branch + if: ${{ github.event_name == 'push' }} + uses: JamesIves/github-pages-deploy-action@v4.2.2 + with: + branch: release/erlang/wallet-server/master + folder: out/erlang-server-wallet + commit-message: Release ${{ github.repository }}@${{ github.sha }} + +# + + - name: Deploy erlang-client-payres artifact to release branch + if: ${{ github.event_name == 'push' }} + uses: JamesIves/github-pages-deploy-action@v4.2.2 + with: + branch: release/erlang/payres-client/master + folder: out/erlang-client-payres + commit-message: Release ${{ github.repository }}@${{ github.sha }} + + - name: Deploy erlang-server-payres artifact to release branch + if: ${{ github.event_name == 'push' }} + uses: JamesIves/github-pages-deploy-action@v4.2.2 + with: + branch: release/erlang/payres-server/master + folder: out/erlang-server-payres + commit-message: Release ${{ github.repository }}@${{ github.sha }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..1958e71 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,29 @@ +name: release +on: + push: + branches: [master] + +env: + NODEJS_VERSION: '16' + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + - name: Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: ${{ env.NODEJS_VERSION }} + cache: npm + - run: npm install + - name: Bundle specification + run: npm run patch + - name: Deploy to release branch + uses: JamesIves/github-pages-deploy-action@4.1.4 + with: + branch: release/master + folder: dist/api + target-folder: api + commit-message: release ${{ github.repository }}@${{ github.sha }} by ${{ github.actor }} \ No newline at end of file