diff --git a/.github/workflows/build-artifact.yml b/.github/workflows/build-artifact.yml new file mode 100644 index 0000000..216a2bb --- /dev/null +++ b/.github/workflows/build-artifact.yml @@ -0,0 +1,44 @@ +name: Build and Publish Artifact + +# on: +# push: +# branches: +# - main + +on: workflow_dispatch + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set Node.js 18.x + uses: actions/setup-node@v3 + with: + node-version: 18.x + + - name: Yarn install + uses: borales/actions-yarn@v4 + with: + cmd: install + dir: core + + - name: Compile application + uses: borales/actions-yarn@v4 + with: + cmd: compile + dir: core + + - name: Build artifact + uses: borales/actions-yarn@v4 + with: + cmd: generate:artifact + dir: core + + - name: Release + uses: softprops/action-gh-release@v1 + with: + files: artifacts/terraapprove diff --git a/core/package.json b/core/package.json index d7b7736..30c71f3 100644 --- a/core/package.json +++ b/core/package.json @@ -7,7 +7,7 @@ "compile": "nest build", "test": "yarn jest {libs/**/*.test.ts,main/**/*.test.ts}", "prepush-validation": "yarn lint && yarn compile && yarn test", - "generate:artifact": "(rm ../artifacts/terraapprove || true) && yarn pkg --targets node18-linux --output ../artifacts/terraapprove --compress GZip ./build/main/src/main.js" + "generate:artifact": "(rm ../artifacts/terraapprove 2>/dev/null || true) && yarn pkg --targets node18-linux --output ../artifacts/terraapprove --compress GZip ./build/main/src/main.js" }, "name": "terraapprove", "version": "0.0.1",