From 5e73b5ab9bd19fcd0fe55ff6c0fc9e98e23a696a Mon Sep 17 00:00:00 2001 From: George Sokianos Date: Mon, 15 Jan 2024 15:42:21 +0000 Subject: [PATCH 1/9] Added more jobs --- .../{buildWithDocker.yml => mergeMaster.yml} | 0 .github/workflows/prChecks.yml | 25 +++++++++++++ .github/workflows/tagRelease.yml | 37 +++++++++++++++++++ 3 files changed, 62 insertions(+) rename .github/workflows/{buildWithDocker.yml => mergeMaster.yml} (100%) create mode 100644 .github/workflows/prChecks.yml create mode 100644 .github/workflows/tagRelease.yml diff --git a/.github/workflows/buildWithDocker.yml b/.github/workflows/mergeMaster.yml similarity index 100% rename from .github/workflows/buildWithDocker.yml rename to .github/workflows/mergeMaster.yml diff --git a/.github/workflows/prChecks.yml b/.github/workflows/prChecks.yml new file mode 100644 index 00000000..8c0da7b0 --- /dev/null +++ b/.github/workflows/prChecks.yml @@ -0,0 +1,25 @@ +Aname: Build with Docker +on: + push: + pull_request: + branches: + - master + workflow_dispatch: + +jobs: + run: + name: Build latest code + runs-on: ubuntu-latest + container: + image: walkero/amigagccondocker:os4-gcc11-exp + volumes: + - '${{ github.workspace }}:/opt/code' + steps: + - name: Pull code + uses: actions/checkout@v2 + - name: Compile clib4 + run: | + cd /opt/code && \ + make -j1 -f GNUmakefile.os4 OS=os4 SHARED=no + - name: Create the release archive + run: make -f GNUmakefile.os4 release \ No newline at end of file diff --git a/.github/workflows/tagRelease.yml b/.github/workflows/tagRelease.yml new file mode 100644 index 00000000..f109c245 --- /dev/null +++ b/.github/workflows/tagRelease.yml @@ -0,0 +1,37 @@ +Aname: Make a new release +on: + release: + branches: + - master + - actions-cicd + types: + - published + +jobs: + run: + name: Build latest code + runs-on: ubuntu-latest + container: + image: walkero/amigagccondocker:os4-gcc11-exp + volumes: + - '${{ github.workspace }}:/opt/code' + steps: + - name: Pull code + uses: actions/checkout@v2 + - name: Compile clib4 + run: | + cd /opt/code && \ + make -j1 -f GNUmakefile.os4 OS=os4 SHARED=no + - name: Create the release archive + run: | + make -f GNUmakefile.os4 release + mv clib4.lha clib4-${{ github.event.release.tag_name }}.lha + - name: Upload Release Archive + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: /opt/code/clib4-${{ github.event.release.tag_name }}.lha + asset_name: clib4-${{ github.event.release.tag_name }}.lha + asset_content_type: application/x-lzh-compressed \ No newline at end of file From 6e9cda1cb4113f9c2e827620e73d307ea363890c Mon Sep 17 00:00:00 2001 From: George Sokianos Date: Mon, 15 Jan 2024 15:44:24 +0000 Subject: [PATCH 2/9] Renamed the PR action --- .github/workflows/prChecks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/prChecks.yml b/.github/workflows/prChecks.yml index 8c0da7b0..84bc2aa7 100644 --- a/.github/workflows/prChecks.yml +++ b/.github/workflows/prChecks.yml @@ -1,4 +1,4 @@ -Aname: Build with Docker +Aname: PR build - checking the build on: push: pull_request: From 2bf59d7b721c170bf41a187c6e3fc8ae9b5ac36a Mon Sep 17 00:00:00 2001 From: George Sokianos Date: Mon, 15 Jan 2024 15:57:40 +0000 Subject: [PATCH 3/9] Fixes and removal of duplicate job --- .github/workflows/makeRelease.yml | 2 ++ .github/workflows/mergeMaster.yml | 3 +-- .github/workflows/prChecks.yml | 2 +- .github/workflows/tagRelease.yml | 37 ------------------------------- 4 files changed, 4 insertions(+), 40 deletions(-) delete mode 100644 .github/workflows/tagRelease.yml diff --git a/.github/workflows/makeRelease.yml b/.github/workflows/makeRelease.yml index 1b248cd5..19b03270 100644 --- a/.github/workflows/makeRelease.yml +++ b/.github/workflows/makeRelease.yml @@ -1,6 +1,8 @@ name: Make a new release on: release: + branches: + - master types: - published diff --git a/.github/workflows/mergeMaster.yml b/.github/workflows/mergeMaster.yml index ccf7f3fb..b0d91a86 100644 --- a/.github/workflows/mergeMaster.yml +++ b/.github/workflows/mergeMaster.yml @@ -1,9 +1,8 @@ -name: Build with Docker +name: Push to master build on: push: branches: - master - - actions-cicd pull_request: workflow_dispatch: diff --git a/.github/workflows/prChecks.yml b/.github/workflows/prChecks.yml index 84bc2aa7..070103fc 100644 --- a/.github/workflows/prChecks.yml +++ b/.github/workflows/prChecks.yml @@ -1,4 +1,4 @@ -Aname: PR build - checking the build +Aname: Pull request build on: push: pull_request: diff --git a/.github/workflows/tagRelease.yml b/.github/workflows/tagRelease.yml deleted file mode 100644 index f109c245..00000000 --- a/.github/workflows/tagRelease.yml +++ /dev/null @@ -1,37 +0,0 @@ -Aname: Make a new release -on: - release: - branches: - - master - - actions-cicd - types: - - published - -jobs: - run: - name: Build latest code - runs-on: ubuntu-latest - container: - image: walkero/amigagccondocker:os4-gcc11-exp - volumes: - - '${{ github.workspace }}:/opt/code' - steps: - - name: Pull code - uses: actions/checkout@v2 - - name: Compile clib4 - run: | - cd /opt/code && \ - make -j1 -f GNUmakefile.os4 OS=os4 SHARED=no - - name: Create the release archive - run: | - make -f GNUmakefile.os4 release - mv clib4.lha clib4-${{ github.event.release.tag_name }}.lha - - name: Upload Release Archive - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ github.event.release.upload_url }} - asset_path: /opt/code/clib4-${{ github.event.release.tag_name }}.lha - asset_name: clib4-${{ github.event.release.tag_name }}.lha - asset_content_type: application/x-lzh-compressed \ No newline at end of file From 3de8151d16ffb0650405b4116bcd1580fc0e998c Mon Sep 17 00:00:00 2001 From: George Sokianos Date: Mon, 15 Jan 2024 16:22:37 +0000 Subject: [PATCH 4/9] Added DEB creation and some fixes in PR action --- .github/workflows/makeRelease.yml | 17 ++++++++++++++--- .github/workflows/prChecks.yml | 3 +++ GNUmakefile.os4 | 2 +- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/.github/workflows/makeRelease.yml b/.github/workflows/makeRelease.yml index 19b03270..3f3c204c 100644 --- a/.github/workflows/makeRelease.yml +++ b/.github/workflows/makeRelease.yml @@ -21,11 +21,14 @@ jobs: run: | cd /opt/code && \ make -j1 -f GNUmakefile.os4 OS=os4 SHARED=no - - name: Create the release archive + - name: Create the LHA release archive run: | make -f GNUmakefile.os4 release && \ mv clib4.lha clib4-${{ github.event.release.tag_name }}.lha - - name: Upload Release Asset + - name: Create the DEB release archive + run: | + make -f GNUmakefile.os4 dpkg DPKG_LIB=clib4_${{ github.event.release.tag_name }}_amd64 + - name: Upload LHA release file in GitHub uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -34,7 +37,15 @@ jobs: asset_path: /opt/code/clib4-${{ github.event.release.tag_name }}.lha asset_name: clib4-${{ github.event.release.tag_name }}.lha asset_content_type: application/x-lzh-compressed + - name: Upload DEB release file in GitHub + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: /opt/code/clib4_${{ github.event.release.tag_name }}_amd64.deb + asset_name: clib4_${{ github.event.release.tag_name }}_amd64.deb + asset_content_type: application/vnd.debian.binary-package # - name: Release on OS4Depot # - name: Release on Aminet - # - name: Prepare Ubuntu apt packages # - name: Release on Ubuntu apt server \ No newline at end of file diff --git a/.github/workflows/prChecks.yml b/.github/workflows/prChecks.yml index 070103fc..a4c4c39a 100644 --- a/.github/workflows/prChecks.yml +++ b/.github/workflows/prChecks.yml @@ -4,6 +4,9 @@ on: pull_request: branches: - master + types: + - opened + - reopened workflow_dispatch: jobs: diff --git a/GNUmakefile.os4 b/GNUmakefile.os4 index 206cdfed..6aa66620 100644 --- a/GNUmakefile.os4 +++ b/GNUmakefile.os4 @@ -55,7 +55,7 @@ LIB_ROOT ?= $(shell pwd) LIB_DIR = $(LIB_ROOT)/library BUILD_DIR = $(LIB_ROOT)/build OUTPUT_LIB = $(BUILD_DIR)/lib -DPKG_LIB = clib4_1.0_amd64 +DPKG_LIB ?= clib4_1.0_amd64 ############################################################################## From da17a464986c77089212e8e95baaa7eaa3f626b3 Mon Sep 17 00:00:00 2001 From: George Sokianos Date: Mon, 15 Jan 2024 16:29:04 +0000 Subject: [PATCH 5/9] A small fix --- .github/workflows/prChecks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/prChecks.yml b/.github/workflows/prChecks.yml index a4c4c39a..78ef6f2a 100644 --- a/.github/workflows/prChecks.yml +++ b/.github/workflows/prChecks.yml @@ -1,4 +1,4 @@ -Aname: Pull request build +name: Pull request build on: push: pull_request: From db2735dd8e102926f4a3ad9ca36865086303f9a4 Mon Sep 17 00:00:00 2001 From: George Sokianos Date: Mon, 15 Jan 2024 16:44:59 +0000 Subject: [PATCH 6/9] Use checkout 4 and restrict the merge job when PR is merged --- .github/workflows/makeRelease.yml | 2 +- .github/workflows/mergeMaster.yml | 13 +++++++------ .github/workflows/prChecks.yml | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/makeRelease.yml b/.github/workflows/makeRelease.yml index 3f3c204c..81881ad8 100644 --- a/.github/workflows/makeRelease.yml +++ b/.github/workflows/makeRelease.yml @@ -16,7 +16,7 @@ jobs: - '${{ github.workspace }}:/opt/code' steps: - name: Pull code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Compile clib4 run: | cd /opt/code && \ diff --git a/.github/workflows/mergeMaster.yml b/.github/workflows/mergeMaster.yml index b0d91a86..33301163 100644 --- a/.github/workflows/mergeMaster.yml +++ b/.github/workflows/mergeMaster.yml @@ -1,13 +1,14 @@ -name: Push to master build +name: Merge into master build on: - push: + pull_request: branches: - master - pull_request: - workflow_dispatch: + types: + - closed jobs: - run: + run_if_merged: + if: github.event.pull_request.merged == true name: Build latest code runs-on: ubuntu-latest container: @@ -16,7 +17,7 @@ jobs: - '${{ github.workspace }}:/opt/code' steps: - name: Pull code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Compile clib4 run: | cd /opt/code && \ diff --git a/.github/workflows/prChecks.yml b/.github/workflows/prChecks.yml index 78ef6f2a..c3186553 100644 --- a/.github/workflows/prChecks.yml +++ b/.github/workflows/prChecks.yml @@ -19,7 +19,7 @@ jobs: - '${{ github.workspace }}:/opt/code' steps: - name: Pull code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Compile clib4 run: | cd /opt/code && \ From 3155d382ce0dd7d64fe1678fe7d10d762ff5d144 Mon Sep 17 00:00:00 2001 From: George Sokianos Date: Mon, 15 Jan 2024 18:40:56 +0000 Subject: [PATCH 7/9] Added action to upload to ssh server --- .github/workflows/makeRelease.yml | 29 ++++++++++++++++++++++++++--- .github/workflows/prChecks.yml | 2 -- os4depot.readme | 28 ++++++++++++++++++++++++++++ 3 files changed, 54 insertions(+), 5 deletions(-) create mode 100644 os4depot.readme diff --git a/.github/workflows/makeRelease.yml b/.github/workflows/makeRelease.yml index 81881ad8..d701afc2 100644 --- a/.github/workflows/makeRelease.yml +++ b/.github/workflows/makeRelease.yml @@ -45,7 +45,30 @@ jobs: upload_url: ${{ github.event.release.upload_url }} asset_path: /opt/code/clib4_${{ github.event.release.tag_name }}_amd64.deb asset_name: clib4_${{ github.event.release.tag_name }}_amd64.deb - asset_content_type: application/vnd.debian.binary-package + asset_content_type: application/vnd.debian.binary-pac + - name: Upload DEB file to the server + uses: appleboy/scp-action@v0.1.7 + with: + host: ${{ secrets.DEBSERVER_HOST }} + username: ${{ secrets.DEBSERVER_USERNAME }} + port: ${{ secrets.DEBSERVER_PORT }} + key: ${{ secrets.DEBSERVER_PRIVATE_KEY }} + source: "clib4_${{ github.event.release.tag_name }}_amd64.deb" + target: /opt/ + # - name: Prepare OS4Depot release + # run: | + # mkdir os4depot-release + # cp clib4-${{ github.event.release.tag_name }}.lha ./os4depot-release/clib4.lha + # cp ./os4depot.readme ./os4depot-release/clib4_lha.readme + # sed -i "s/VERSION_TAG/${{ github.event.release.tag_name }}/" ./os4depot-release/os4depot.readme + # sed -i "s/OS4DEPOT_PASSPHRASE/${{ secrets.OS4DEPOT_PASSPHRASE }}/" ./os4depot-release/os4depot.readme # - name: Release on OS4Depot - # - name: Release on Aminet - # - name: Release on Ubuntu apt server \ No newline at end of file + # uses: SamKirkland/FTP-Deploy-Action@v4.3.4 + # with: + # server: os4depot.net + # port: 21 + # username: ftp + # password: + # server-dir: ./upload + # local-dir: /opt/code/os4depot-release/ + # - name: Release on Ubuntu apt server diff --git a/.github/workflows/prChecks.yml b/.github/workflows/prChecks.yml index c3186553..331a4644 100644 --- a/.github/workflows/prChecks.yml +++ b/.github/workflows/prChecks.yml @@ -1,13 +1,11 @@ name: Pull request build on: - push: pull_request: branches: - master types: - opened - reopened - workflow_dispatch: jobs: run: diff --git a/os4depot.readme b/os4depot.readme new file mode 100644 index 00000000..915c0c1f --- /dev/null +++ b/os4depot.readme @@ -0,0 +1,28 @@ +name: clib4 +description: clib4 library +version: VERSION_TAG +author: Andrea Palmatè +submitter: Andrea Palmatè +email: andrea@amigasoft.net +url: https://github.com/AmigaLabs/clib4 +category: development/library/misc +replaces: development/library/misc/clib4.lha +requirements: adtools +license: BSD +minosversion: 4.1 +distribute: yes +passphrase: OS4DEPOT_PASSPHRASE +hend: +This is a fork of official clib2 present in adtools. The point of this +library is to make it Amiga OS4 only to maintain it easily and add all the +missing clib2 features that are difficult to add also on classic Amigas. +Classic Amigas has also ixemul that is the most complete, POSIX compliant, +library we have. It is a useless share code that most probably no one will +use. The goal is to try to make it POSIX compliant and fix also all the C++ +problems we have with newer compilers. All warnings (except really few ones) +produced by GCC 10 and above are now gone. + +All deprecated OS4 functions are replaced by modern OS4 one. + +If you find any issue, please let us know at: +https://github.com/AmigaLabs/clib4/issues From e61921f3d62670abb35b248b3d6b2167f5948554 Mon Sep 17 00:00:00 2001 From: George Sokianos Date: Mon, 15 Jan 2024 19:45:22 +0000 Subject: [PATCH 8/9] Changed the SCP action to one that can have commands executed before and after the upload --- .github/workflows/makeRelease.yml | 59 ++++++++++++++++--------------- 1 file changed, 31 insertions(+), 28 deletions(-) diff --git a/.github/workflows/makeRelease.yml b/.github/workflows/makeRelease.yml index d701afc2..ed75972f 100644 --- a/.github/workflows/makeRelease.yml +++ b/.github/workflows/makeRelease.yml @@ -27,7 +27,7 @@ jobs: mv clib4.lha clib4-${{ github.event.release.tag_name }}.lha - name: Create the DEB release archive run: | - make -f GNUmakefile.os4 dpkg DPKG_LIB=clib4_${{ github.event.release.tag_name }}_amd64 + make -f GNUmakefile.os4 dpkg DPKG_LIB=clib4-${{ github.event.release.tag_name }}_amd64 - name: Upload LHA release file in GitHub uses: actions/upload-release-asset@v1 env: @@ -43,32 +43,35 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ github.event.release.upload_url }} - asset_path: /opt/code/clib4_${{ github.event.release.tag_name }}_amd64.deb - asset_name: clib4_${{ github.event.release.tag_name }}_amd64.deb + asset_path: /opt/code/clib4-${{ github.event.release.tag_name }}_amd64.deb + asset_name: clib4-${{ github.event.release.tag_name }}_amd64.deb asset_content_type: application/vnd.debian.binary-pac - - name: Upload DEB file to the server - uses: appleboy/scp-action@v0.1.7 + - name: Upload DEB release file to the server + uses: kostya-ten/ssh-server-deploy@v4 + with: + host: ${{ secrets.DEBSERVER_HOST }} + port: ${{ secrets.DEBSERVER_PORT }} + username: ${{ secrets.DEBSERVER_USERNAME }} + private_key: ${{ secrets.DEBSERVER_PRIVATE_KEY }} + scp_source: clib4-${{ github.event.release.tag_name }}_amd64.deb + scp_target: /opt/amigarepo/ubuntu/pool/main + before_script: | + rm /opt/amigarepo/ubuntu/pool/main/clib4-*.deb + after_script: | + /root/regenerate-packages.sh + - name: Prepare OS4Depot release + run: | + mkdir os4depot-release + cp clib4-${{ github.event.release.tag_name }}.lha ./os4depot-release/clib4.lha + cp ./os4depot.readme ./os4depot-release/clib4_lha.readme + sed -i "s/VERSION_TAG/${{ github.event.release.tag_name }}/" ./os4depot-release/os4depot.readme + sed -i "s/OS4DEPOT_PASSPHRASE/${{ secrets.OS4DEPOT_PASSPHRASE }}/" ./os4depot-release/os4depot.readme + - name: Release on OS4Depot + uses: SamKirkland/FTP-Deploy-Action@v4.3.4 with: - host: ${{ secrets.DEBSERVER_HOST }} - username: ${{ secrets.DEBSERVER_USERNAME }} - port: ${{ secrets.DEBSERVER_PORT }} - key: ${{ secrets.DEBSERVER_PRIVATE_KEY }} - source: "clib4_${{ github.event.release.tag_name }}_amd64.deb" - target: /opt/ - # - name: Prepare OS4Depot release - # run: | - # mkdir os4depot-release - # cp clib4-${{ github.event.release.tag_name }}.lha ./os4depot-release/clib4.lha - # cp ./os4depot.readme ./os4depot-release/clib4_lha.readme - # sed -i "s/VERSION_TAG/${{ github.event.release.tag_name }}/" ./os4depot-release/os4depot.readme - # sed -i "s/OS4DEPOT_PASSPHRASE/${{ secrets.OS4DEPOT_PASSPHRASE }}/" ./os4depot-release/os4depot.readme - # - name: Release on OS4Depot - # uses: SamKirkland/FTP-Deploy-Action@v4.3.4 - # with: - # server: os4depot.net - # port: 21 - # username: ftp - # password: - # server-dir: ./upload - # local-dir: /opt/code/os4depot-release/ - # - name: Release on Ubuntu apt server + server: os4depot.net + port: 21 + username: ftp + password: + server-dir: ./upload + local-dir: /opt/code/os4depot-release/ From b66a5ab69f010848f6f39584300607b82433702c Mon Sep 17 00:00:00 2001 From: George Sokianos Date: Mon, 15 Jan 2024 20:26:41 +0000 Subject: [PATCH 9/9] Removed the dash --- .github/workflows/makeRelease.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/makeRelease.yml b/.github/workflows/makeRelease.yml index ed75972f..db437264 100644 --- a/.github/workflows/makeRelease.yml +++ b/.github/workflows/makeRelease.yml @@ -56,7 +56,7 @@ jobs: scp_source: clib4-${{ github.event.release.tag_name }}_amd64.deb scp_target: /opt/amigarepo/ubuntu/pool/main before_script: | - rm /opt/amigarepo/ubuntu/pool/main/clib4-*.deb + rm /opt/amigarepo/ubuntu/pool/main/clib4*.deb after_script: | /root/regenerate-packages.sh - name: Prepare OS4Depot release