Skip to content

Merge pull request #64 from arkahna/update-dev-dependencies #139

Merge pull request #64 from arkahna/update-dev-dependencies

Merge pull request #64 from arkahna/update-dev-dependencies #139

Workflow file for this run

name: Build & Test CI
concurrency: main
env:
CI: true
on:
push:
branches:
- main
jobs:
ci:
runs-on: ubuntu-latest
outputs:
changes: ${{ steps.version.outputs.changes }} # map step output to job output
steps:
- name: Checkout
uses: actions/checkout@v3
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0
- name: Enable node
uses: actions/setup-node@v3
with:
node-version: 18.x
registry-url: 'https://registry.npmjs.org'
scope: '@featureboard'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Setup NuGet
uses: nuget/setup-nuget@v1
with:
nuget-api-key: ${{ secrets.NUGET_API_KEY }}
nuget-version: '5.x'
- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: 8
- name: Cache .pnpm-store
uses: actions/cache@v3
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-node${{ matrix.node-version }}-${{ hashFiles('**/pnpm-lock.yaml') }}
- name: Disable verify-store-integrity
run: |
pnpm set verify-store-integrity false
- name: pnpm install
run: |
pnpm install
- name: Version command
id: version
run: |
npx changeset version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Update DotNet SDK version and copyright year
run: |
version=$(node -pe "require('./libs/dotnet-sdk/package.json').version")
currentYear=$(node -pe "new Date().getFullYear()")
csproj_path=libs/dotnet-sdk/FeatureBoard.DotnetSdk.csproj
sed -i "s/<Version>.*<\/Version>/<Version>$version<\/Version>/" $csproj_path
sed -i "s/<Copyright>.*<\/Copyright>/<Copyright>Copyright (c) Arkahna $currentYear<\/Copyright>/" $csproj_path
- name: Push changes
run: |
pnpm i -r --no-frozen-lockfile
git config user.email "jake@featureboard.app"
git config user.name "Jake Ginnivan"
git add -A
git commit -m "Version packages [skip ci]" || echo "No changes to commit"
git push
- name: Type check
run: pnpm tsc -b
- name: Lint, build and test
run: pnpm nx run-many --target build,lint,test,package --all --exclude examples-dotnet-api
- name: Release NPM packages
run: pnpm publish -r --access public
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Release NuGet package
run: nuget push dist/libs/dotnet-sdk/*.nupkg -Source 'https://api.nuget.org/v3/index.json' -SkipDuplicate