From 929db6ae70a5a4485685642678d03cffdd3f0ab2 Mon Sep 17 00:00:00 2001 From: Jerry Hu Date: Sat, 3 Jun 2023 01:01:06 +0000 Subject: [PATCH] release.yml --- .github/workflows/release.yml | 59 +++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000000..e10327b059b --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,59 @@ +name: Release + +on: + workflow_dispatch: + inputs: + branch: + description: 'Target branch' + required: true + type: string + tag: + description: 'Target tag' + required: true + type: string + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + # The branch, tag or SHA to checkout. When checking out the repository that + # triggered a workflow, this defaults to the reference or SHA for that event. + # Otherwise, uses the default branch. + ref: ${{ inputs.branch }} + + - name: Setup node + uses: actions/setup-node@v3 + with: + node-version: '16.x' + cache: 'npm' + + - name: Build + run: npm ci + + - name: Patch for release + run: | + sed -i 's/{#COMMIT_HASH#}/${{ inputs.tag }}/' JitsiMeetJS.ts + sed -i '/"module"/a\ "main": "dist/umd/lib-jitsi-meet.min.js",\n "types": "types/auto/JitsiMeetJS.d.ts",' package.json + + - name: Create bundle + run: | + npm pack + mv lib-jitsi-meet-0.0.0.tgz lib-jitsi-meet.tgz + + - name: Create Tag + uses: rickstaa/action-create-tag@v1 + with: + tag: ${{ inputs.tag }} + message: "Release ${{ inputs.tag }}" + force_push_tag: true + + - uses: softprops/action-gh-release@v1 + with: + tag_name: ${{ inputs.tag }} + prerelease: true + fail_on_unmatched_files: true + files: | + lib-jitsi-meet.tgz