diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2926faa..4ad720c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,10 +27,13 @@ jobs: - name: Build Version id: version env: + GIT_REF: ${{ github.ref }} VERSION_OVERRIDE: ${{ inputs.release_version }} run: | if [ -n "$VERSION_OVERRIDE" ]; then version="$VERSION_OVERRIDE" + elif [[ "$GIT_REF" == refs/heads/release/npm/* ]]; then + version="${GIT_REF#refs/heads/release/npm/}" else dotnet tool install --global minver-cli --version 7.0.0 version=$(minver --tag-prefix v) @@ -124,11 +127,11 @@ jobs: scope: "@foundatiofx" - name: Publish Release Package - if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch' + if: startsWith(github.ref, 'refs/tags/v') || startsWith(github.ref, 'refs/heads/release/npm/') || github.event_name == 'workflow_dispatch' run: npm publish fetchclient.tgz --provenance --access public - name: Setup GitHub CI Node.js environment - if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch' + if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') || startsWith(github.ref, 'refs/heads/release/npm/') || github.event_name == 'workflow_dispatch' uses: actions/setup-node@v7 with: node-version: "24.x" @@ -136,13 +139,13 @@ jobs: scope: "@foundatiofx" - name: Push GitHub CI Packages - if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch' + if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') || startsWith(github.ref, 'refs/heads/release/npm/') || github.event_name == 'workflow_dispatch' run: | package="@foundatiofx/fetchclient@${{ needs.lint.outputs.version }}" if npm view "$package" version --registry https://npm.pkg.github.com > /dev/null 2>&1; then echo "$package already exists in GitHub Packages; skipping publish." else - npm publish fetchclient.tgz --tag ${{ (startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch') && 'latest' || 'next' }} --access public + npm publish fetchclient.tgz --tag ${{ (startsWith(github.ref, 'refs/tags/v') || startsWith(github.ref, 'refs/heads/release/npm/') || github.event_name == 'workflow_dispatch') && 'latest' || 'next' }} --access public fi env: NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}