build_application #62
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.4 | |
- name: Transpile | |
run: tapper --project ./hypeproxy-dotnet/src/HypeProxy/HypeProxy.csproj --output ./build --enum name | |
- name: Add source files to transpiled files | |
run: cp -R ./src/* ./build | |
- name: Generate index.ts | |
run: | | |
rm -rf ./build/index.ts | |
find ./build -name "*.ts" ! -name "index.ts" | xargs basename -s .ts | sort | xargs -I '{}' bash -c 'echo "export * from \"./{}\";"' >> ./build/index.ts | |
- name: Bump Version | |
run: | | |
chmod +x "${GITHUB_WORKSPACE}/.github/bump.sh" | |
"${GITHUB_WORKSPACE}/.github/bump.sh" | |
- name: Cleanup | |
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: npm | |
- run: npm run build | |
- run: rm -rf ./build | |
- run: npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: Update package |