diff --git a/.github/workflows/deploy-test.yml b/.github/workflows/deploy-test.yml index e07b464c47..cf5544d7c9 100644 --- a/.github/workflows/deploy-test.yml +++ b/.github/workflows/deploy-test.yml @@ -6,7 +6,7 @@ on: - main jobs: - build-and-deploy: + build-and-test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000000..dc7605a249 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,68 @@ +name: Build and Release + +on: + workflow_dispatch: # Allows manual triggering from the GitHub UI + push: + tags: + - "v*" # Triggers on tag push matching v1.0, v1.1, etc. + +jobs: + build-and-release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: "20" + cache: "yarn" + + - name: Install Yarn + run: npm install -g yarn + + - name: Install dependencies + run: yarn install + + - name: Build + run: yarn bundle + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref_name }} + draft: false + prerelease: false + + - name: Upload Production Bundle + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./packages/core/umd/production/index.min.js + asset_name: core.min.js + asset_content_type: application/javascript + + - name: Upload Development Bundle + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./packages/core/umd/development/index.js + asset_name: core.js + asset_content_type: application/javascript + + - name: Upload Development Source Map + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./packages/core/umd/development/index.js.map + asset_name: core.js.map + asset_content_type: application/json diff --git a/.gitignore b/.gitignore index 9f0623f255..bb9c93196e 100644 --- a/.gitignore +++ b/.gitignore @@ -18,4 +18,4 @@ examples/candid-ui examples/*/deps/candid docs .nx -bundle \ No newline at end of file +umd \ No newline at end of file diff --git a/examples/html/index.html b/examples/html/index.html index 647cc8160e..19de02dd7f 100644 --- a/examples/html/index.html +++ b/examples/html/index.html @@ -90,10 +90,10 @@