Skip to content

build_application

build_application #57

Workflow file for this run

name: Release
on: repository_dispatch
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Clone hypeproxy-dotnet
run: git clone https://github.com/hypeproxy/hypeproxy-dotnet
- name: Restore Dependencies
run: dotnet restore ./hypeproxy-dotnet/src/HypeProxy/HypeProxy.csproj
- name: Build
run: dotnet build ./hypeproxy-dotnet/src/HypeProxy/HypeProxy.csproj --configuration Release
- name: Install Tapper
run: dotnet tool install --global Tapper.Generator --version 1.8.3
- name: Prevent HypeProxy.ts files for deletion
run: mv src/HypeProxy.ts .
- name: Transpile
run: tapper --project ./hypeproxy-dotnet/src/HypeProxy/HypeProxy.csproj --output ./src/ --enum name
- name: Restore HypeProxy.ts files
run: mv HypeProxy.ts ./src/
- name: Generate index.ts
run: |
echo "" > ./src/index.ts
find ./src -name "*.ts" ! -name "index.ts" | xargs basename -s .ts | sort | xargs -I '{}' bash -c 'echo "export * from \"./{}\";"' >> ./src/index.ts
- name: Bump Version
run: |
chmod +x "${GITHUB_WORKSPACE}/.github/bump.sh"
"${GITHUB_WORKSPACE}/.github/bump.sh"
- name: Remove hypeproxy-dotnet
run: rm -rf ./hypeproxy-dotnet
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v3
with:
node-version: "16.x"
registry-url: "https://registry.npmjs.org"
- run: yarn
- run: yarn build
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Update package