From ead257a1037728251006d64fd624e416eebbb862 Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 26 Apr 2024 14:48:36 +0300 Subject: [PATCH] Update GitHub workflows --- .github/workflows/build.yml | 35 ++++++++ .github/workflows/check-commit-message.yml | 15 ---- .github/workflows/check-formatting.yml | 5 -- ...eck-pr-title.yml => check-semantic-pr.yml} | 13 ++- .github/workflows/main.yml | 79 ------------------- .github/workflows/release-snap.yml | 3 - .github/workflows/release.yml | 40 +++++----- .github/workflows/test-arm64.yml | 48 ----------- 8 files changed, 66 insertions(+), 172 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 .github/workflows/check-commit-message.yml rename .github/workflows/{check-pr-title.yml => check-semantic-pr.yml} (54%) delete mode 100644 .github/workflows/main.yml delete mode 100644 .github/workflows/test-arm64.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..a28bd04 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,35 @@ +name: Build + +on: + workflow_call: + pull_request: + +permissions: + contents: write + + +env: + GRADLE_OPTS: "-Dorg.gradle.jvmargs=-Xmx4g -Dorg.gradle.daemon=false -Dkotlin.incremental=false" + +jobs: + build: + runs-on: ubuntu-latest #add macos + + steps: + - uses: actions/checkout@v4 + + - name: Generate and submit dependency graph + uses: gradle/actions/dependency-submission@v3 + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v3 + + # make sure ncurses is installed + - name: Build with Gradle + run: ./gradlew assemble + + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: dist + path: build/bin/**/* \ No newline at end of file diff --git a/.github/workflows/check-commit-message.yml b/.github/workflows/check-commit-message.yml deleted file mode 100644 index 1f269ef..0000000 --- a/.github/workflows/check-commit-message.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: Check commit message - -on: [ pull_request ] - -permissions: - contents: read - pull-requests: read - -jobs: - check-commit-message: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - uses: wagoid/commitlint-github-action@v6 diff --git a/.github/workflows/check-formatting.yml b/.github/workflows/check-formatting.yml index 8542c32..cb9a1a8 100644 --- a/.github/workflows/check-formatting.yml +++ b/.github/workflows/check-formatting.yml @@ -1,11 +1,6 @@ name: Check formatting on: - push: - tags: - - v* - branches: - - main pull_request: permissions: diff --git a/.github/workflows/check-pr-title.yml b/.github/workflows/check-semantic-pr.yml similarity index 54% rename from .github/workflows/check-pr-title.yml rename to .github/workflows/check-semantic-pr.yml index 9855e03..15a5388 100644 --- a/.github/workflows/check-pr-title.yml +++ b/.github/workflows/check-semantic-pr.yml @@ -1,4 +1,4 @@ -name: "Check PR title" +name: "Check semantics of PR title and commits" on: pull_request_target: @@ -9,12 +9,19 @@ on: permissions: pull-requests: read + contents: read jobs: - main: - name: Check PR title + check-pr-title: runs-on: ubuntu-latest steps: - uses: amannn/action-semantic-pull-request@v5 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + check-commit-message: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: wagoid/commitlint-github-action@v6 \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index 0c2e45e..0000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,79 +0,0 @@ -name: MacOS Build - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -permissions: - contents: write - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - name: Set up JDK 17 - uses: actions/setup-java@v2 - with: - java-version: '17' - distribution: 'adopt' - - - name: Install ncurses - run: | - pkg-config --static --libs ncurses - ls -la /usr/include/x86_64-linux-gnu - ls -la /usr/lib/x86_64-linux-gnu - ls -la /usr/include - ls -la /usr/include/ncurses - sudo apt-get install libncurses5-dev - dpkg-query -L libncurses5-dev - getconf GNU_LIBC_VERSION - continue-on-error: true - - - name: Install Kotlin - uses: sdkman/sdkman-action@master - with: - candidate: kotlin - version: '1.9.22' - - - name: Grant execute permission for gradlew - run: chmod +x gradlew - - - name: Generate and submit dependency graph - uses: gradle/actions/dependency-submission@v3 - - - name: Setup Gradle - uses: gradle/actions/setup-gradle@v3 - - - name: Build with Gradle - run: ./gradlew assemble - continue-on-error: true - - - name: Print environment information - run: | - uname -a - java -version - kotlin -version - xcrun --show-sdk-path - xcode-select -p - ls -la /Library/Developer/CommandLineTools/SDKs - continue-on-error: true - - - name: Check cinterop output - run: | - ls -la /usr/local/opt/ncurses/lib - ls -la /usr/local/opt/ncurses/include - ls -la build/classes/kotlin/native/main/cinterop/ - ls -la build/classes/kotlin/native/main/cinterop/dogcat-cinterop-ncurses.klib-build/ - continue-on-error: true - - - - name: Archive production artifacts - uses: actions/upload-artifact@v2 - with: - name: dist - path: build/bin/**/* diff --git a/.github/workflows/release-snap.yml b/.github/workflows/release-snap.yml index 19f4cb9..e70c696 100644 --- a/.github/workflows/release-snap.yml +++ b/.github/workflows/release-snap.yml @@ -2,9 +2,6 @@ name: Build and Release Snap on: workflow_call: - secrets: - snap: - required: false workflow_dispatch: jobs: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 76dc54c..18e0aa5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,8 +1,7 @@ -name: build and publish +name: Release on: push: - #branches: [ main ] tags: - '*' @@ -10,52 +9,55 @@ env: GRADLE_OPTS: "-Dorg.gradle.jvmargs=-Xmx4g -Dorg.gradle.daemon=false -Dkotlin.incremental=false" jobs: - checkGradleWrapper: + check-gradle-wrapper: uses: NorseDreki/dogcat/.github/workflows/check-gradle-wrapper.yml@main - build: - needs: checkGradleWrapper + release-notes: runs-on: ubuntu-latest - steps: - uses: actions/checkout@v4 - - name: Setup Gradle - uses: gradle/actions/setup-gradle@v3 - - - name: Build with Gradle - run: ./gradlew assemble - - name: Extract release notes id: release_notes uses: ffurrer2/extract-release-notes@v2 with: release_notes_file: RELEASE_NOTES.md - releaseBrew: + - name: Upload release notes + uses: actions/upload-artifact@v4 + with: + name: release-notes + path: RELEASE_NOTES.md + + build: + needs: check-gradle-wrapper + uses: NorseDreki/dogcat/.github/workflows/build.yml@main + + release-brew: needs: build uses: NorseDreki/dogcat/.github/workflows/release-brew.yml@main secrets: inherit - releaseSnap: + release-snap: needs: build uses: NorseDreki/dogcat/.github/workflows/release-snap.yml@main secrets: inherit createRelease: - needs: [ checkGradleWrapper ] + needs: [ build, release-notes, release-brew, release-snap ] runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - name: Download release notes + uses: actions/download-artifact@v4 + with: + name: release-notes - name: Create Release uses: softprops/action-gh-release@v2 if: startsWith(github.ref, 'refs/tags/') with: - body: 'some body for release лрпрп' + body_path: release-notes/RELEASE_NOTES.md draft: false prerelease: false - files: | - CHANGELOG.md env: GITHUB_TOKEN: ${{ secrets.PAT }} diff --git a/.github/workflows/test-arm64.yml b/.github/workflows/test-arm64.yml deleted file mode 100644 index 25bb404..0000000 --- a/.github/workflows/test-arm64.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: MacOS Build - -on: - push: - branches: [ main ] - -permissions: - contents: write - -jobs: - build: - strategy: - matrix: - os: [ubuntu-22.04, macos-10.15, macos-11, macos-12, macos-13, macos-14] - runs-on: ${{ matrix.os }} - - steps: - - uses: actions/checkout@v4 - - - name: Set up Homebrew - uses: Homebrew/actions/setup-homebrew@master - - - name: Install Formula - run: | - brew install ncurses - brew doctor - - - name: Install Kotlin - uses: sdkman/sdkman-action@master - with: - candidate: kotlin - version: '1.9.22' - - - name: Generate and submit dependency graph - uses: gradle/actions/dependency-submission@v3 - - - name: Setup Gradle - uses: gradle/actions/setup-gradle@v3 - - - name: Build with Gradle - run: ./gradlew assemble - continue-on-error: true - - - name: Archive production artifacts - uses: actions/upload-artifact@v4 - with: - name: dist - path: build/bin/**/* \ No newline at end of file