Skip to content

Commit

Permalink
release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
jerry2013 committed Dec 29, 2023
1 parent ca40744 commit cc1c43c
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
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 }}
# 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=$(git log -1 --format='%H')" >> "$GITHUB_ENV"
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: '16.x'
cache: 'npm'

- name: Build & Bundle
run: |
npm ci
sed -i 's/{#COMMIT_HASH#}/${{ inputs.tag }}/' JitsiMeetJS.ts
npm pack
mv lib-jitsi-meet-0.0.0.tgz lib-jitsi-meet.tgz
- name: Create Tag
run: |
git config --global user.name "${{ github.actor }}"
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
git tag -f -a ${{ inputs.tag }} -m "Release ${{ inputs.tag }}"
git push -f origin ${{ inputs.tag }}
- uses: softprops/action-gh-release@v1
with:
tag_name: ${{ inputs.tag }}
prerelease: true
fail_on_unmatched_files: true
files: |
lib-jitsi-meet.tgz
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,9 @@ npm run build
```

Both linting and units will also be done by a pre-commit hook.

## Release

```
gh workflow run release.yml --ref release-workflow -f branch=<branch> -f tag=<tag>
```

0 comments on commit cc1c43c

Please sign in to comment.