From e9329e1584a4688dea98128876fc8e195c11b341 Mon Sep 17 00:00:00 2001 From: worksofliam Date: Fri, 17 Nov 2023 10:14:36 -0500 Subject: [PATCH 01/15] Update build flow --- .github/workflows/ibmi.yml | 58 +++++++++++++++++++------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/.github/workflows/ibmi.yml b/.github/workflows/ibmi.yml index fd0d5d3..663ddc7 100644 --- a/.github/workflows/ibmi.yml +++ b/.github/workflows/ibmi.yml @@ -12,44 +12,44 @@ on: - 'ile/**' env: - ssh_command: ssh ${{ secrets.IBMI_BUILD_USRPRF }}@${{ secrets.IBMI_BUILD_SYS }} - scp_dist_command: scp ${{ secrets.IBMI_BUILD_USRPRF }}@${{ secrets.IBMI_BUILD_SYS }}:/home/${{ secrets.IBMI_BUILD_USRPRF }}/build/${{ github.sha }}/manzan-${{ github.ref_name }}.zip . - remote_build_dir: /home/${{ secrets.IBMI_BUILD_USRPRF }}/build/${{ github.sha }} - rsync_command: rsync -a --exclude='./.*' --exclude='./runners' --exclude='./.git' --exclude='./docs' --rsync-path=/QOpenSys/pkgs/bin/rsync ./ ${{ secrets.IBMI_BUILD_USRPRF }}@${{ secrets.IBMI_BUILD_SYS }}:/home/${{ secrets.IBMI_BUILD_USRPRF }}/build/${{ github.sha }}/ + remote_build_dir: /home/${{ secrets.IBMI_USER }}/build/${{ github.sha }} jobs: build: runs-on: ubuntu-latest + environment: OSSBUILD + permissions: + packages: read + contents: read steps: - uses: actions/checkout@v2 - - name: Install private key - run: | - mkdir -p ~/.ssh - chmod 0755 ~ - chmod 0700 ~/.ssh - echo "${{ secrets.IBMI_BUILD_PVTKEY }}" > ~/.ssh/id_rsa - chmod 0600 ~/.ssh/id_rsa - - name: Disable strict host key checking - run: | - echo "Host *" > ~/.ssh/config - echo " StrictHostKeyChecking no" >> ~/.ssh/config - - name: Create build sandbox - run: $ssh_command "mkdir -p $remote_build_dir" - - name: Clean up unnecessary files - run: rm -fr ./.git ./docs - - name: Populate build sandbox - run: $rsync_command + - uses: actions/setup-node@v3 + with: + node-version: 18 + registry-url: https://npm.pkg.github.com/ + + - run: npm i -g @ibm/ibmi-ci + env: + NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} + - name: Get short SHA ID run: | echo "short_sha=$(echo ${{ github.sha }} | head -c 5)" >> $GITHUB_ENV cat $GITHUB_ENV - - name: Perform remote build - run: $ssh_command "cd $remote_build_dir && /QOpenSys/pkgs/bin/gmake -C ile BUILDLIB=MZNCI$short_sha uninstall all" - - name: Cleanup remote dist lib - if: always() - run: $ssh_command "system 'dltlib MZNCI$short_sha'" - - name: Cleanup remote build dir - if: always() - run: $ssh_command "rm -fr $remote_build_dir" + + - name: Deploy to IBM i + run: | + ici \ + --cmd "mkdir -p '$remote_build_dir'" \ + --rcwd "$remote_build_dir" \ + --push "." \ + --cmd "/QOpenSys/pkgs/bin/gmake -C ile BUILDLIB=MZNCI$short_sha uninstall all" \ + --ignore --cl "dltlib MZNCI$short_sha" \ + --ignore --cmd "rm -fr $remote_build_dir" + env: + IBMI_HOST: ${{ secrets.IBMI_HOST }} + IBMI_USER: ${{ secrets.IBMI_USER }} + IBMI_PASSWORD: ${{ secrets.IBMI_PASSWORD }} + IBMI_SSH_PORT: ${{ secrets.IBMI_SSH_PORT }} \ No newline at end of file From cad9ba443ad6562429a94d7319f2769a533a85ff Mon Sep 17 00:00:00 2001 From: worksofliam Date: Fri, 17 Nov 2023 10:15:00 -0500 Subject: [PATCH 02/15] Random comment, to be removed --- ile/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ile/Makefile b/ile/Makefile index 3f4e780..3e7d7cf 100644 --- a/ile/Makefile +++ b/ile/Makefile @@ -1,6 +1,8 @@ BUILDLIB:=MANZAN BUILDVERSION:="Development build \(built with Make\)" +# Hello world + all: init /qsys.lib/${BUILDLIB}.lib/handler.pgm init: /qsys.lib/${BUILDLIB}.lib /qsys.lib/${BUILDLIB}.lib/manzanmsg.file /qsys.lib/${BUILDLIB}.lib/manzanoth.file /qsys.lib/${BUILDLIB}.lib/manzanpal.file /qsys.lib/${BUILDLIB}.lib/manzanvlog.file /qsys.lib/${BUILDLIB}.lib/manzandtaq.dtaq From 2258c921805e949bb23b24e1184525395acfde94 Mon Sep 17 00:00:00 2001 From: worksofliam Date: Fri, 17 Nov 2023 10:17:13 -0500 Subject: [PATCH 03/15] Remove comment --- .github/workflows/ibmi.yml | 1 + ile/Makefile | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ibmi.yml b/.github/workflows/ibmi.yml index 663ddc7..5f546ba 100644 --- a/.github/workflows/ibmi.yml +++ b/.github/workflows/ibmi.yml @@ -25,6 +25,7 @@ jobs: steps: - uses: actions/checkout@v2 + - uses: actions/setup-node@v3 with: node-version: 18 diff --git a/ile/Makefile b/ile/Makefile index 3e7d7cf..3f4e780 100644 --- a/ile/Makefile +++ b/ile/Makefile @@ -1,8 +1,6 @@ BUILDLIB:=MANZAN BUILDVERSION:="Development build \(built with Make\)" -# Hello world - all: init /qsys.lib/${BUILDLIB}.lib/handler.pgm init: /qsys.lib/${BUILDLIB}.lib /qsys.lib/${BUILDLIB}.lib/manzanmsg.file /qsys.lib/${BUILDLIB}.lib/manzanoth.file /qsys.lib/${BUILDLIB}.lib/manzanpal.file /qsys.lib/${BUILDLIB}.lib/manzanvlog.file /qsys.lib/${BUILDLIB}.lib/manzandtaq.dtaq From 7cc24f635cc717be767401a2ea82f22cc6e87abe Mon Sep 17 00:00:00 2001 From: worksofliam Date: Fri, 17 Nov 2023 10:18:32 -0500 Subject: [PATCH 04/15] Add comment back --- ile/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ile/Makefile b/ile/Makefile index 3f4e780..3e7d7cf 100644 --- a/ile/Makefile +++ b/ile/Makefile @@ -1,6 +1,8 @@ BUILDLIB:=MANZAN BUILDVERSION:="Development build \(built with Make\)" +# Hello world + all: init /qsys.lib/${BUILDLIB}.lib/handler.pgm init: /qsys.lib/${BUILDLIB}.lib /qsys.lib/${BUILDLIB}.lib/manzanmsg.file /qsys.lib/${BUILDLIB}.lib/manzanoth.file /qsys.lib/${BUILDLIB}.lib/manzanpal.file /qsys.lib/${BUILDLIB}.lib/manzanvlog.file /qsys.lib/${BUILDLIB}.lib/manzandtaq.dtaq From 40973dbddcfc89e58149d81b88eba77144d1597f Mon Sep 17 00:00:00 2001 From: worksofliam Date: Fri, 17 Nov 2023 10:19:45 -0500 Subject: [PATCH 05/15] Force the registry --- .github/workflows/ibmi.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ibmi.yml b/.github/workflows/ibmi.yml index 5f546ba..e15a8dc 100644 --- a/.github/workflows/ibmi.yml +++ b/.github/workflows/ibmi.yml @@ -25,13 +25,13 @@ jobs: steps: - uses: actions/checkout@v2 - + - uses: actions/setup-node@v3 with: node-version: 18 registry-url: https://npm.pkg.github.com/ - - run: npm i -g @ibm/ibmi-ci + - run: npm i -g @ibm/ibmi-ci --registry=https://npm.pkg.github.com/ env: NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} From 96371d38714ed71b4baced4845466459ab46bb3f Mon Sep 17 00:00:00 2001 From: worksofliam Date: Fri, 17 Nov 2023 10:21:33 -0500 Subject: [PATCH 06/15] Use v4 --- .github/workflows/ibmi.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ibmi.yml b/.github/workflows/ibmi.yml index e15a8dc..b9a421d 100644 --- a/.github/workflows/ibmi.yml +++ b/.github/workflows/ibmi.yml @@ -26,12 +26,12 @@ jobs: steps: - uses: actions/checkout@v2 - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: 18 registry-url: https://npm.pkg.github.com/ - - run: npm i -g @ibm/ibmi-ci --registry=https://npm.pkg.github.com/ + - run: npm i -g @ibm/ibmi-ci env: NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} From c3678238a6a198f0e97243022fdb7d5479f880b1 Mon Sep 17 00:00:00 2001 From: worksofliam Date: Fri, 17 Nov 2023 10:24:23 -0500 Subject: [PATCH 07/15] Use reg parm --- .github/workflows/ibmi.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ibmi.yml b/.github/workflows/ibmi.yml index b9a421d..dedf833 100644 --- a/.github/workflows/ibmi.yml +++ b/.github/workflows/ibmi.yml @@ -29,9 +29,8 @@ jobs: - uses: actions/setup-node@v4 with: node-version: 18 - registry-url: https://npm.pkg.github.com/ - - run: npm i -g @ibm/ibmi-ci + - run: npm i -g @ibm/ibmi-ci --registry=https://npm.pkg.github.com/ env: NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} From e6db7860b3a2aaf7f83ba59e89d1759254263889 Mon Sep 17 00:00:00 2001 From: worksofliam Date: Fri, 17 Nov 2023 10:27:45 -0500 Subject: [PATCH 08/15] Try again --- .github/workflows/ibmi.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/ibmi.yml b/.github/workflows/ibmi.yml index dedf833..4737c52 100644 --- a/.github/workflows/ibmi.yml +++ b/.github/workflows/ibmi.yml @@ -19,9 +19,6 @@ jobs: runs-on: ubuntu-latest environment: OSSBUILD - permissions: - packages: read - contents: read steps: - uses: actions/checkout@v2 From 285ecd64bb9b26cae6714f351f3b53e5d8a11480 Mon Sep 17 00:00:00 2001 From: worksofliam Date: Fri, 17 Nov 2023 10:35:30 -0500 Subject: [PATCH 09/15] Use PAT --- .github/workflows/ibmi.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ibmi.yml b/.github/workflows/ibmi.yml index 4737c52..25c9e0e 100644 --- a/.github/workflows/ibmi.yml +++ b/.github/workflows/ibmi.yml @@ -29,7 +29,7 @@ jobs: - run: npm i -g @ibm/ibmi-ci --registry=https://npm.pkg.github.com/ env: - NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} + NODE_AUTH_TOKEN: ${{secrets.PACKAGE_TOKEN}} - name: Get short SHA ID run: | From 3dd7f63e0b8c9dc1f838ff01ca1243c6b9ecc362 Mon Sep 17 00:00:00 2001 From: worksofliam Date: Fri, 17 Nov 2023 10:36:43 -0500 Subject: [PATCH 10/15] try better env var --- .github/workflows/ibmi.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ibmi.yml b/.github/workflows/ibmi.yml index 25c9e0e..3f0aa33 100644 --- a/.github/workflows/ibmi.yml +++ b/.github/workflows/ibmi.yml @@ -29,7 +29,7 @@ jobs: - run: npm i -g @ibm/ibmi-ci --registry=https://npm.pkg.github.com/ env: - NODE_AUTH_TOKEN: ${{secrets.PACKAGE_TOKEN}} + NPM_TOKEN: ${{secrets.PACKAGE_TOKEN}} - name: Get short SHA ID run: | From 981e43f885e864ba8f09d38e3073e550bc016b36 Mon Sep 17 00:00:00 2001 From: worksofliam Date: Fri, 17 Nov 2023 10:39:21 -0500 Subject: [PATCH 11/15] Read perms --- .github/workflows/ibmi.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ibmi.yml b/.github/workflows/ibmi.yml index 3f0aa33..5d8767a 100644 --- a/.github/workflows/ibmi.yml +++ b/.github/workflows/ibmi.yml @@ -19,6 +19,8 @@ jobs: runs-on: ubuntu-latest environment: OSSBUILD + permissions: + packages: read steps: - uses: actions/checkout@v2 From f4e1dbab7a826d958088440aff24a8b7564222c2 Mon Sep 17 00:00:00 2001 From: worksofliam Date: Fri, 17 Nov 2023 10:41:22 -0500 Subject: [PATCH 12/15] Try always auth --- .github/workflows/ibmi.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ibmi.yml b/.github/workflows/ibmi.yml index 5d8767a..0e7a3de 100644 --- a/.github/workflows/ibmi.yml +++ b/.github/workflows/ibmi.yml @@ -27,6 +27,7 @@ jobs: - uses: actions/setup-node@v4 with: + always-auth: true node-version: 18 - run: npm i -g @ibm/ibmi-ci --registry=https://npm.pkg.github.com/ From 8cb3fc6a914be53744df1ef9760818741ddd0e51 Mon Sep 17 00:00:00 2001 From: worksofliam Date: Fri, 17 Nov 2023 13:47:47 -0500 Subject: [PATCH 13/15] Use npm package to get ibmi-ci --- .github/workflows/ibmi.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/ibmi.yml b/.github/workflows/ibmi.yml index 0e7a3de..f3e7911 100644 --- a/.github/workflows/ibmi.yml +++ b/.github/workflows/ibmi.yml @@ -30,9 +30,7 @@ jobs: always-auth: true node-version: 18 - - run: npm i -g @ibm/ibmi-ci --registry=https://npm.pkg.github.com/ - env: - NPM_TOKEN: ${{secrets.PACKAGE_TOKEN}} + - run: npm i -g @ibm/ibmi-ci - name: Get short SHA ID run: | From a270d2c49023535b8b39993b2faa4c9dab907b8d Mon Sep 17 00:00:00 2001 From: worksofliam Date: Sat, 18 Nov 2023 15:36:36 -0500 Subject: [PATCH 14/15] Cleanup for IBM i build --- .github/workflows/ibmi.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/ibmi.yml b/.github/workflows/ibmi.yml index f3e7911..7e1c588 100644 --- a/.github/workflows/ibmi.yml +++ b/.github/workflows/ibmi.yml @@ -16,11 +16,8 @@ env: jobs: build: - runs-on: ubuntu-latest environment: OSSBUILD - permissions: - packages: read steps: - uses: actions/checkout@v2 @@ -40,11 +37,11 @@ jobs: - name: Deploy to IBM i run: | ici \ - --cmd "mkdir -p '$remote_build_dir'" \ --rcwd "$remote_build_dir" \ --push "." \ --cmd "/QOpenSys/pkgs/bin/gmake -C ile BUILDLIB=MZNCI$short_sha uninstall all" \ --ignore --cl "dltlib MZNCI$short_sha" \ + --rcwd ".." \ --ignore --cmd "rm -fr $remote_build_dir" env: IBMI_HOST: ${{ secrets.IBMI_HOST }} From 314c14b553ead24f6c4784700ed184f162f4afc7 Mon Sep 17 00:00:00 2001 From: worksofliam Date: Sat, 18 Nov 2023 15:37:15 -0500 Subject: [PATCH 15/15] Remove comment --- ile/Makefile | 2 -- 1 file changed, 2 deletions(-) diff --git a/ile/Makefile b/ile/Makefile index 3e7d7cf..3f4e780 100644 --- a/ile/Makefile +++ b/ile/Makefile @@ -1,8 +1,6 @@ BUILDLIB:=MANZAN BUILDVERSION:="Development build \(built with Make\)" -# Hello world - all: init /qsys.lib/${BUILDLIB}.lib/handler.pgm init: /qsys.lib/${BUILDLIB}.lib /qsys.lib/${BUILDLIB}.lib/manzanmsg.file /qsys.lib/${BUILDLIB}.lib/manzanoth.file /qsys.lib/${BUILDLIB}.lib/manzanpal.file /qsys.lib/${BUILDLIB}.lib/manzanvlog.file /qsys.lib/${BUILDLIB}.lib/manzandtaq.dtaq