chore(release): 1.0.0 #85
Workflow file for this run
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: Release Artifacts | |
| on: | |
| push: | |
| tags: | |
| # Trigger on any tag push (including pre-releases - create-rwsdk will by default not choose pre-releases) | |
| - "v*.*.*" | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: "Version name (optional, used for filenames)" | |
| required: false | |
| default: "" | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Enable Corepack | |
| run: corepack enable | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24.14.0 | |
| cache: "pnpm" | |
| - name: Get tag or input version | |
| id: vars | |
| run: | | |
| if [ "${{ github.event_name }}" = "workflow_dispatch" ] && [ -n "${{ github.event.inputs.version }}" ]; then | |
| echo "version=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT | |
| else | |
| echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Update starter package.json | |
| run: | | |
| version_without_v="${{ steps.vars.outputs.version }}" | |
| (cd starter && npm pkg set dependencies.rwsdk=${version_without_v#v}) | |
| pnpm install --ignore-scripts --no-frozen-lockfile | |
| - name: Update addon package.json files | |
| run: | | |
| version_without_v="${{ steps.vars.outputs.version }}" | |
| for dir in ./addons/*/ ; do | |
| if [ -f "${dir}package.json" ]; then | |
| echo "Updating package.json in ${dir}" | |
| (cd "$dir" && npm pkg set dependencies.rwsdk=${version_without_v#v}) | |
| fi | |
| done | |
| - name: Package starter and addon folders | |
| run: | | |
| mkdir -p output | |
| # Package starter | |
| tar -czvf output/starter-${{ steps.vars.outputs.version }}.tar.gz --exclude-vcs-ignores -C starter . | |
| git ls-files starter | zip output/starter-${{ steps.vars.outputs.version }}.zip -@ | |
| # Package addons | |
| for dir in ./addons/*/ ; do | |
| folder_name=$(basename "$dir") | |
| tar -czvf output/${folder_name}-${{ steps.vars.outputs.version }}.tar.gz --exclude-vcs-ignores -C "$dir" . | |
| git ls-files "$dir" | zip output/${folder_name}-${{ steps.vars.outputs.version }}.zip -@ | |
| done | |
| - name: Upload packaged artifacts to GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: output/* | |
| tag_name: ${{ steps.vars.outputs.version }} | |
| prerelease: ${{ contains(steps.vars.outputs.version, '-') && !contains(steps.vars.outputs.version, '-beta.') }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |