Release and Publish #16
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release and Publish | |
on: | |
workflow_dispatch: | |
inputs: | |
publish-npm: | |
description: "choose true if want publish to npm" | |
default: false | |
type: boolean | |
jobs: | |
release-it: | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Setup | |
uses: ./.github/actions/setup | |
- name: Setup Dependencies 💚 | |
run: | | |
pnpm install | |
- name: Zip It Up 🤐 | |
run: | | |
pnpm build | |
tar -czvf agora-rtc-sdk-ng-fake.tar.gz dist | |
- name: Upload Artifact ⬆️ | |
uses: actions/upload-artifact@v3 | |
with: | |
name: agora-rtc-sdk-ng-fake.tar.gz | |
path: agora-rtc-sdk-ng-fake.tar.gz | |
- name: Setup NPM auth token | |
if: ${{ inputs.publish-npm }} | |
run: | | |
npm set "//registry.npmjs.org/:_authToken" ${{ secrets.NPM_TOKEN }} | |
- name: Config Git | |
run: | | |
git config --global user.email "${{ github.actor }}@users.noreply.github.com" | |
git config --global user.name "${{ github.actor }}" | |
- name: Get Package Info | |
id: package-info | |
run: | | |
version=$(node -p "require('./package.json').version") | |
echo "version=${version}" >> "$GITHUB_OUTPUT" | |
- name: Update VERSION | |
run: | | |
pnpm exec esbuild-dev $PWD/scripts/release/update-version.ts @${{ steps.package-info.outputs.version }} | |
- name: Release and Publish | |
run: | | |
pnpm release ${{ steps.package-info.outputs.version }} --ci --npm.publish=${{ inputs.publish-npm }} --github.update --github.assets=agora-rtc-sdk-ng-fake.tar.gz |