Release and Publish #24
Workflow file for this run
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: | |
jobs: | |
release-it: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- uses: pnpm/action-setup@v2.2.4 | |
with: | |
version: latest | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "16.x" | |
cache: "pnpm" | |
registry-url: "https://npm.pkg.github.com" | |
# Defaults to the user or organization that owns the workflow file | |
scope: "@agoraio-extensions" | |
- name: Setup Dependencies 💚 | |
run: | | |
pnpm install | |
- name: Zip It Up 🤐 | |
run: | | |
pnpm build | |
tar -czvf agora-rtc-sdk-ng-fake.tar.gz dist | |
- name: publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
cd dist | |
npm publish --no-git-checks | |
- 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 --github.assets=agora-rtc-sdk-ng-fake.tar.gz |