From dd324dbfde46f58b856d5a74ace746923e42617f Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Thu, 25 Jan 2024 22:20:17 -0300 Subject: [PATCH 1/7] Debugging macos auto build. --- .github/workflows/macos.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 9f42e82e..88dc2f67 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -15,6 +15,8 @@ jobs: brew update brew install xz automake binutils coreutils curl gettext libtool openssl pkgconfig find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/*' -delete + rm -f /usr/local/bin/go || true + rm -f /usr/local/bin/gofmt || true brew upgrade - name: build run: ./mac/ci-build.sh From 13c89a2cb4dca0ecb79d5a29ad0915e632dd1bdc Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Sun, 18 Feb 2024 20:19:21 -0300 Subject: [PATCH 2/7] Updating workflows. --- .github/workflows/codeql.yml | 102 +++++++++++++++++++++++++--------- .github/workflows/macos.yml | 11 ++-- .github/workflows/msys2.yml | 30 ++++++++++ .github/workflows/publish.yml | 28 ++++------ 4 files changed, 123 insertions(+), 48 deletions(-) create mode 100644 .github/workflows/msys2.yml diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 8983622b..18e33397 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -1,41 +1,89 @@ ---- -name: CodeQL +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +# +# ******** NOTE ******** +# We have attempted to detect the languages in your repository. Please check +# the `language` matrix defined below to confirm you have the correct set of +# supported CodeQL languages. +# +name: "CodeQL" + on: push: - branches: - - develop - - master + branches: [ "develop" ] pull_request: - branches: - - develop + branches: [ "master" ] + jobs: analyze: name: Analyze + # Runner size impacts CodeQL analysis time. To learn more, please see: + # - https://gh.io/recommended-hardware-resources-for-running-codeql + # - https://gh.io/supported-runners-and-hardware-resources + # - https://gh.io/using-larger-runners + # Consider using larger runners for possible analysis time improvements. runs-on: ubuntu-22.04 + timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }} permissions: + # required for all workflows + security-events: write + + # only required for workflows in private repositories actions: read contents: read - security-events: write + strategy: fail-fast: false matrix: - language: - - cpp + language: [ 'c-cpp' ] + # CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ] + # Use only 'java-kotlin' to analyze code written in Java, Kotlin or both + # Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both + # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support + steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Install Packages - run: | - sudo apt-get update - sudo apt-get install --yes git make autopoint gettext libssl-dev libcurl4-openssl-dev - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: ${{ matrix.language }} - queries: +security-and-quality - - name: Autobuild - uses: github/codeql-action/autobuild@v2 - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 - with: - category: /language:${{ matrix.language }} + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install Packages + run: | + echo 'deb https://download.opensuse.org/repositories/home:/PerryWerneck:/udjat/xUbuntu_22.04/ /' | sudo tee /etc/apt/sources.list.d/home:PerryWerneck:udjat.list + curl -fsSL https://download.opensuse.org/repositories/home:/PerryWerneck:/udjat/xUbuntu_22.04/Release.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/home_PerryWerneck_udjat.gpg > /dev/null + sudo apt-get update + sudo apt-get install --yes make autotools-dev autoconf automake pkg-config gettext libssl-dev libcurl4-openssl-dev + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + + # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs + # queries: security-extended,security-and-quality + + + # Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v3 + + # ℹī¸ Command-line programs to run using the OS shell. + # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun + + # If the Autobuild fails above, remove it and uncomment the following three lines. + # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. + + # - run: | + # echo "Run, Build Application using script" + # ./location_of_script_within_repo/buildscript.sh + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 + with: + category: "/language:${{matrix.language}}" diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 9f42e82e..e24d3aa2 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -1,11 +1,12 @@ -name: MacOS Test +name: check-macos on: push: - branches: - - macos + branches: [ "macos" ] + pull_request: + branches: [ "master" ] + jobs: - build: - name: Build for macos + macos-build: runs-on: macos-latest steps: - name: Checkout diff --git a/.github/workflows/msys2.yml b/.github/workflows/msys2.yml new file mode 100644 index 00000000..c34ace38 --- /dev/null +++ b/.github/workflows/msys2.yml @@ -0,0 +1,30 @@ +name: check-msys2 +on: + push: + branches: [ "win" ] + pull_request: + branches: [ "master" ] + +jobs: + msys2-build: + runs-on: windows-latest + defaults: + run: + shell: msys2 {0} + steps: + - uses: actions/checkout@v3 + - uses: oprypin/find-latest-tag@v1 + id: gettag + with: + repository: PerryWerneck/lib3270 + releases-only: true + - uses: msys2/setup-msys2@v2 + with: + msystem: mingw64 + update: true + install: dos2unix mingw-w64-x86_64-gcc automake autoconf make git pkgconf mingw-w64-x86_64-gettext gettext-devel mingw-w64-x86_64-openssl libtool + - name: CI-Build + run: | + dos2unix PKGBUILD.mingw + makepkg BUILDDIR=/tmp/pkg -p PKGBUILD.mingw + diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index f1e9bff1..9dec0fe1 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,14 +1,11 @@ name: Publish on: push: - branches: - - develop - pull_request: - branches: - - master + branches: [ "win" ] + tags: [ "*" ] + jobs: - msys2-mingw: - name: Publish for MinGW 64 + publish-mingw: runs-on: windows-latest defaults: run: @@ -24,23 +21,23 @@ jobs: with: msystem: mingw64 update: true - install: zip dos2unix mingw-w64-x86_64-gcc automake autoconf make git pkgconf mingw-w64-x86_64-gettext gettext-devel mingw-w64-x86_64-openssl libtool + install: dos2unix mingw-w64-x86_64-gcc automake autoconf make git pkgconf mingw-w64-x86_64-gettext gettext-devel mingw-w64-x86_64-openssl libtool - name: CI-Build - run: ./win/mingw-build.sh - - name: Bundle - run: ./win/bundle.msys --build + run: | + pacman -U --noconfirm *.pkg.tar.zst + dos2unix PKGBUILD.mingw + makepkg BUILDDIR=/tmp/pkg -p PKGBUILD.mingw - uses: ncipollo/release-action@v1 with: tag: ${{ steps.gettag.outputs.tag }} - artifacts: "*-lib3270-*.pkg.tar.zst,*-lib3270-*.zip" + artifacts: "*3270*.pkg.tar.zst" allowUpdates: true draft: false makeLatest: true omitBody: true omitPrereleaseDuringUpdate: true replacesArtifacts: true - msys2-msvc: - name: Publish devel for MSVC 64 + publish-msvc: runs-on: windows-latest defaults: run: @@ -69,8 +66,7 @@ jobs: omitBody: true omitPrereleaseDuringUpdate: true replacesArtifacts: true - macos: - name: Publish for macos + publish-macos: runs-on: macos-latest steps: - name: Checkout From eb7f421d3d744a0f8da455a4a8bd0fb9ddfc5588 Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Sun, 18 Feb 2024 22:56:54 -0300 Subject: [PATCH 3/7] Debugging macos workflow. --- .github/workflows/macos.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 88dc2f67..39ea8432 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -1,11 +1,12 @@ -name: MacOS Test +name: check-macos on: push: - branches: - - macos + branches: [ "macos" ] + pull_request: + branches: [ "master" ] + jobs: - build: - name: Build for macos + macos-build: runs-on: macos-latest steps: - name: Checkout @@ -15,6 +16,7 @@ jobs: brew update brew install xz automake binutils coreutils curl gettext libtool openssl pkgconfig find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/*' -delete + find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/*' -delete rm -f /usr/local/bin/go || true rm -f /usr/local/bin/gofmt || true brew upgrade From 63e4fafe2f7044894d05ed9eabcded27c5b08d2e Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Sun, 18 Feb 2024 23:13:53 -0300 Subject: [PATCH 4/7] Debugging macos workflow. --- .github/workflows/macos.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 39ea8432..1f56cf66 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -17,6 +17,7 @@ jobs: brew install xz automake binutils coreutils curl gettext libtool openssl pkgconfig find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/*' -delete find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/*' -delete + find /usr/local/lib/node_modules/npm -delete rm -f /usr/local/bin/go || true rm -f /usr/local/bin/gofmt || true brew upgrade From 668c24d2de243ec349d950ec1d50a0c72ad24ad9 Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Sun, 18 Feb 2024 23:30:09 -0300 Subject: [PATCH 5/7] Debuggin macos publisher. --- .github/workflows/publish.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 9dec0fe1..f8931e9c 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,7 +1,7 @@ name: Publish on: push: - branches: [ "win" ] + branches: [ "macos" ] tags: [ "*" ] jobs: @@ -81,6 +81,8 @@ jobs: brew update brew install xz automake binutils coreutils curl gettext libtool openssl pkgconfig find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/*' -delete + find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/*' -delete + find /usr/local/lib/node_modules/npm -delete rm -f /usr/local/bin/go || true rm -f /usr/local/bin/gofmt || true brew upgrade From 357750c7e0189f80f742dfc73e9e8243d5f7aa04 Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Sun, 18 Feb 2024 23:44:58 -0300 Subject: [PATCH 6/7] Debugging publisher. --- .github/workflows/publish.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index f8931e9c..a404d34a 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -24,7 +24,6 @@ jobs: install: dos2unix mingw-w64-x86_64-gcc automake autoconf make git pkgconf mingw-w64-x86_64-gettext gettext-devel mingw-w64-x86_64-openssl libtool - name: CI-Build run: | - pacman -U --noconfirm *.pkg.tar.zst dos2unix PKGBUILD.mingw makepkg BUILDDIR=/tmp/pkg -p PKGBUILD.mingw - uses: ncipollo/release-action@v1 From 0948e5ee44c690b8caa9878d8fbe830eb42c326d Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Mon, 19 Feb 2024 01:18:54 -0300 Subject: [PATCH 7/7] Update codeql.yml --- .github/workflows/codeql.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 18e33397..5ea0a51b 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -13,9 +13,7 @@ name: "CodeQL" on: push: - branches: [ "develop" ] - pull_request: - branches: [ "master" ] + branches: [ "develop", "master" ] jobs: analyze: