Bump axios from 1.7.2 to 1.7.4 in /src/npm #89
Workflow file for this run
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, Test and Deploy Packages | |
on: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- '.github/**' | |
pull_request: | |
branches: | |
- main | |
paths-ignore: | |
- '.github/**' | |
workflow_dispatch: | |
env: | |
npm-path: ./src/npm | |
nuget-sln-path: 'src/NuGet/ColonesExchangeRate.sln' | |
nuget-project-path: 'src/NuGet/ColonesExchangeRate/ColonesExchangeRate.csproj' | |
configuration: 'Release' | |
jobs: | |
build-test-nuget: | |
name: Build & Test NuGet package | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: '8.0.x' | |
- name: Restore dependencies | |
run: dotnet restore ${{ env.nuget-sln-path }} | |
- name: Build solution | |
run: dotnet build ${{ env.nuget-sln-path }} --configuration ${{ env.configuration }} | |
- name: Build package | |
run: dotnet pack ${{ env.nuget-project-path }} --configuration ${{ env.configuration }} | |
- name: Run tests | |
run: dotnet test ${{ env.nuget-sln-path }} | |
- name: Upload package | |
uses: actions/upload-artifact@v3 | |
with: | |
name: NuGet | |
path: '**/*.nupkg' | |
build-test-npm: | |
name: Build & Test npm package | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 'latest' | |
- name: Install dependencies | |
working-directory: ${{ env.npm-path }} | |
run: npm ci | |
- name: Test | |
working-directory: ${{ env.npm-path }} | |
run: npm test | |
- name: Prepare package | |
working-directory: ${{ env.npm-path }} | |
run: npm pack | |
- name: Upload package | |
uses: actions/upload-artifact@v3 | |
with: | |
name: npm | |
path: '**/*.tgz' | |
publish-nuget: | |
name: Publish package to NuGet and GitHub Packages | |
if: github.ref == 'refs/heads/main' | |
needs: build-test-nuget | |
runs-on: ubuntu-latest | |
environment: Production | |
steps: | |
- name: Download package | |
uses: actions/download-artifact@v3 | |
with: | |
name: NuGet | |
- name: Publish to NuGet.org | |
run: dotnet nuget push **/*.nupkg --skip-duplicate --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json | |
- name: Authenticating to GitHub Packages | |
run: dotnet nuget add source --username USERNAME --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/dsanchezcr/index.json" | |
- name: Publish to GitHub Packages | |
run: dotnet nuget push **/*.nupkg --skip-duplicate --api-key ${{ secrets.GITHUB_TOKEN }} --source "github" | |
publish-npm: | |
name: Publish package to npm and GitHub Packages | |
if: github.ref == 'refs/heads/main' | |
needs: build-test-npm | |
runs-on: ubuntu-latest | |
environment: Production | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node.js for npmjs.com | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 'latest' | |
registry-url: 'https://registry.npmjs.org' | |
- name: Copy README | |
run: cp README.md src/npm/ | |
- name: Publish to npmjs.com | |
working-directory: ${{ env.npm-path }} | |
run: | | |
npm publish --access public || echo "Version already exists on npmjs.com" | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_API_KEY }} | |
- name: Set up Node.js for GitHub Packages | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 'latest' | |
registry-url: 'https://npm.pkg.github.com' | |
- name: Publish to GitHub Packages | |
working-directory: ${{ env.npm-path }} | |
run: | | |
npm publish || echo "Version already exists on GitHub Packages" | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |