release: version 1.0.9 with unified automation #13
This file contains hidden or 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: Publish UPM Package | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'package.json' | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| # Step 1: Check out the repository | |
| - name: Check out code | |
| uses: actions/checkout@v4 | |
| # Step 2: Setup Node.js environment | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| # Step 3: Extract version for Tagging | |
| - name: Extract Version | |
| id: get_version | |
| run: | | |
| VERSION=$(grep '"version":' package.json | cut -d'"' -f4) | |
| echo "VERSION=$VERSION" >> $GITHUB_OUTPUT | |
| shell: bash | |
| # Step 4: Run npm pack | |
| - name: Pack Package | |
| id: pack | |
| run: | | |
| # npm pack creates a .tgz file and outputs the name to the console | |
| FILENAME=$(npm pack) | |
| echo "PACKAGE_FILENAME=$FILENAME" >> $GITHUB_ENV | |
| echo "Created package: $FILENAME" | |
| shell: bash | |
| # Step 5: Create Release and Upload the .tgz | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: v${{ steps.get_version.outputs.VERSION }} | |
| name: "Release ${{ steps.get_version.outputs.VERSION }}" | |
| body: | | |
| ## Node Graph Editor ${{ steps.get_version.outputs.VERSION }} | |
| Automated release from `main` branch update. | |
| ### Installation | |
| - **Git URL:** `https://github.com/Selva1910/NodeGraphEditor.git#v${{ steps.get_version.outputs.VERSION }}` | |
| - **Tarball:** Download the `.tgz` below and "Add package from tarball" in Unity. | |
| --- | |
| *Author: Selvaraj Balakrishnan* | |
| *License: AGPLv3 (Attribution Required)* | |
| files: ${{ env.PACKAGE_FILENAME }} | |
| draft: false | |
| prerelease: false |