Skip to content

Increase csolution rpc api version #64

Increase csolution rpc api version

Increase csolution rpc api version #64

Workflow file for this run

name: codegen
on:
push:
branches:
- main
paths:
- '.github/workflows/codegen.yml'
- 'codegen/**'
- 'api/*.yml'
- '!**/*.md'
pull_request:
paths:
- '.github/workflows/codegen.yml'
- 'codegen/**'
- 'api/*.yml'
- '!**/*.md'
release:
types: [published]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
tests:
if: |
${{ github.event_name == 'pull_request' || github.event_name == 'release' }}
timeout-minutes: 15
runs-on: ubuntu-latest
name: 'Test codegen'
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
with:
egress-policy: audit
- name: Checkout csolution-rpc repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Set up Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: 'lts/*'
- name: Install dependencies
run: npm ci
working-directory: codegen
- name: Run linter
run: npm run lint
working-directory: codegen
- name: Run tests
run: npm test
working-directory: codegen
- name: Archive test report
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: codegen-test
path: codegen/reports/junit/testreport.xml
retention-days: 1
if-no-files-found: error
- name: Archive generated interface files
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: codegen-rpc-interfaces
path: codegen/generated/*
retention-days: 1
if-no-files-found: error
release:
if: ${{ github.event_name == 'release' }}
needs: [ tests ]
timeout-minutes: 15
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
with:
egress-policy: audit
- name: Download generated files
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: codegen-rpc-interfaces
path: generated
- name: ZIP generated files
run: zip -r csolution-rpc.zip RpcInterface.h rpc-interface.ts
working-directory: generated
- name: TAR generated files
run: tar -czf csolution-rpc.tar.gz RpcInterface.h rpc-interface.ts
working-directory: generated
- name: Attach files to release assets
id: release_assets
uses: svenstaro/upload-release-action@81c65b7cd4de9b2570615ce3aad67a41de5b1a13 # v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: generated/csolution-rpc.*
tag: ${{ github.ref }}
overwrite: true
file_glob: true