diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index db23f2e..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,48 +0,0 @@ -version: 2 -jobs: - build: - working_directory: /app - docker: - - image: jonathansant/dotnetcore-ci:5.2 - environment: - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 - DOTNET_CLI_TELEMETRY_OPTOUT: 1 - steps: - - run: - name: Print environment versions - command: | - NPM_V=$(npm -v) - echo npm version':' $NPM_V - DOTNET_CLI_V=$(dotnet --version) - echo dotnet cli version':' $DOTNET_CLI_V - - checkout - - run: - name: Restore and build - command: | - SOLUTION=$(node -p "require('./package.json').solution") - - echo "restore packages" - dotnet restore $SOLUTION /p:Configuration=Release - - echo "dotnet publish" - dotnet publish $SOLUTION -c Release - - run: - name: test - command: npm test - - deploy: - name: Publish NuGet - command: | - if [ "$CIRCLE_BRANCH" != "master" ]; then - echo -e "\e[33m Branch does not publish -- exit!" - exit - fi - - SOLUTION=$(node -p "require('./package.json').solution") - PACKAGE_VERSION=$(node -p "require('./package.json').version") - - dotnet pack $SOLUTION /p:PackageVersion=$PACKAGE_VERSION -o ../../ -c release - dotnet nuget push ../../*.nupkg -k $nuget_api_key -s "nuget.org" - - echo "git tag" - git tag $PACKAGE_VERSION - git push --tags \ No newline at end of file diff --git a/.github/workflows/build-publish.yml b/.github/workflows/build-publish.yml new file mode 100644 index 0000000..fd69656 --- /dev/null +++ b/.github/workflows/build-publish.yml @@ -0,0 +1,27 @@ +name: CI + +on: + push: + branches: + - master + - '*.x' + - feature/* + paths-ignore: + - '**.md' + + pull_request: + branches: + - master + - '*.x' + paths-ignore: + - '**.md' + +jobs: + package: + name: Package + uses: jonathansant/.github/.github/workflows/dotnet-ci.yml@main + with: + dotnet-version: 7.0.x + publishable: ${{ contains(fromJSON('["develop", "master", "workflow", "feature/workflow"]'), github.ref_name) || endsWith(github.ref_name, '.x') }} + secrets: + nuget-auth-token: ${{ secrets.NUGET_KEY }} \ No newline at end of file