Merge pull request #821 from mynaparrot/release-please--branches--mai… #112
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: Build and release client | |
on: | |
push: | |
branches: | |
- main | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
release-client: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: googleapis/release-please-action@v4 | |
id: release | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
release-type: node | |
- name: Checkout | |
if: ${{ steps.release.outputs.release_created }} | |
uses: actions/checkout@v4 | |
- name: setup node | |
if: ${{ steps.release.outputs.release_created }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "20.x" | |
- uses: pnpm/action-setup@v4 | |
if: ${{ steps.release.outputs.release_created }} | |
name: Install pnpm | |
with: | |
version: 9 | |
- name: Install dependencies | |
if: ${{ steps.release.outputs.release_created }} | |
run: pnpm install | |
- name: Build project | |
if: ${{ steps.release.outputs.release_created }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
pnpm run build | |
## save latest version tag | |
echo ${{ steps.release.outputs.tag_name }} > dist/version.txt | |
mkdir -p tmp/client | |
rsync -ar LICENSE dist tmp/client/ | |
cd tmp | |
zip -X -r client.zip client | |
gh release upload ${{ steps.release.outputs.tag_name }} client.zip |