diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml new file mode 100644 index 00000000000..c3b9dc8027f --- /dev/null +++ b/.github/workflows/publish-package.yml @@ -0,0 +1,50 @@ +name: publish-package + +on: + pull_request: + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + with: + path: "ddf-ui" + + - name: Set up Node.js + uses: actions/setup-node@v2 + with: + node-version: "16.x" + + - name: Install dependencies + run: | + cd ./ddf-ui/ui-frontend/packages/catalog-ui-search + yarn install + + - name: Build project + run: | + cd ./ddf-ui/ui-frontend/packages/catalog-ui-search + yarn run publish:build + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.event.pull_request.number }} + release_name: Release ${{ github.event.pull_request.number }} + draft: false + prerelease: false + + - name: Upload Asset + id: upload_asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./ddf-ui/ui-frontend/packages/catalog-ui-search/dist + asset_name: catalog-ui-search-${{ github.event.pull_request.number }}.tgz + asset_content_type: application/gzip