ci #388
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: ci | |
on: | |
push: | |
branches: | |
- main | |
tags-ignore: | |
- "*" | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: {} | |
schedule: | |
- cron: 0 18 * * * | |
concurrency: | |
group: ci-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
GRADLE_SWITCHES: --console=plain --info --stacktrace --warning-mode=all --no-daemon | |
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.gradle_enterprise_access_key }} | |
GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.gradle_enterprise_cache_username }} | |
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.gradle_enterprise_cache_password }} | |
RELEASE_BUILD: "true" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
show-progress: false | |
- uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: '8.0.x' | |
- uses: gradle/actions/setup-gradle@v4 | |
- name: set-up-jdk | |
uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: 21 | |
- name: check-java | |
run: java --version | |
- name: build | |
run: | | |
./gradlew ${{ env.GRADLE_SWITCHES }} build | |
(cd Rewrite && dotnet restore Rewrite.sln --no-cache --force --force-evaluate) | |
(cd Rewrite && dotnet build Rewrite.sln --no-restore) | |
- name: test-cs | |
if: "!startsWith(github.event.head_commit.message, '[lst-change]')" | |
run: (cd Rewrite && dotnet test Rewrite.sln --filter "Category!=KnownBug & Category!=Exploratory & Category!=Roslyn") | |
- name: publish-java-snapshots | |
if: github.event_name != 'pull_request' | |
run: ./gradlew ${{ env.GRADLE_SWITCHES }} snapshot publish -PforceSigning -x test | |
env: | |
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.OSSRH_USERNAME }} | |
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.OSSRH_TOKEN }} | |
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.OSSRH_SIGNING_KEY }} | |
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.OSSRH_SIGNING_PASSWORD }} | |
- name: publish-dotnet-snapshots | |
if: github.event_name != 'pull_request' | |
run: | | |
cd Rewrite | |
mkdir ~/localNugetFeed | |
dotnet pack --version-suffix rc.${{ github.run_number }} --output ~/localNuGetFeed Rewrite.sln | |
dotnet nuget push ~/localNuGetFeed/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{env.NUGET_API_KEY}} | |
env: | |
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} |