Erlang build (#9)

* TD-126: Add erlang builds

* mb add release?

* changed to master

* fixed

* fixed checkout
This commit is contained in:
Артем 2022-02-14 19:52:41 +03:00 committed by GitHub
parent c5d7c8d1a4
commit 88e41d6fdc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 112 additions and 0 deletions

83
.github/workflows/release-erlang.yaml vendored Normal file
View File

@ -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 }}

29
.github/workflows/release.yml vendored Normal file
View File

@ -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 }}