Skip to content

Commit

Permalink
release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
jerry2013 committed Dec 28, 2023
1 parent ca40744 commit 8edbbff
Showing 1 changed file with 71 additions and 0 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
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 }}
# Number of commits to fetch. 0 indicates all history for all branches and tags.
# Default: 1
# Workaround due to https://github.com/rickstaa/action-create-tag/issues/36
fetch-depth: 0
# Whether to fetch tags, even if fetch-depth > 0.
# Default: false
fetch-tags: true

- name: Real SHA
run: |
# Workaround due to https://github.com/rickstaa/action-create-tag/issues/36
echo "GITHUB_SHA=$(/usr/bin/git log -1 --format='%H')" >> "$GITHUB_ENV"
- 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

0 comments on commit 8edbbff

Please sign in to comment.