From e9329e1584a4688dea98128876fc8e195c11b341 Mon Sep 17 00:00:00 2001 From: worksofliam Date: Fri, 17 Nov 2023 10:14:36 -0500 Subject: [PATCH 1/3] 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 2/3] 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 3/3] 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