Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -124,25 +127,25 @@ 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"
registry-url: "https://npm.pkg.github.com"
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}}