Add STRWCH command to output #12
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: IBM i build new release | |
on: | |
push: | |
# Sequence of patterns matched against refs/tags | |
tags: | |
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 | |
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-installer-${{ github.ref_name }}.jar . | |
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 }}/ | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
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 | |
- name: Get short SHA ID | |
run: | | |
echo "short_sha=$(echo ${{ github.sha }} | head -c 7)" >> $GITHUB_ENV | |
cat $GITHUB_ENV | |
- name: Perform remote build | |
run: $ssh_command "cd $remote_build_dir && /QOpenSys/pkgs/bin/gmake --jobs=1 manzan-installer-${{ github.ref_name }}.jar" | |
- name: Retrieve artifact | |
run: $scp_dist_command | |
- name: Cleanup remote build lib | |
if: always() | |
run: $ssh_command "system 'dltlib MANZANBLD' || echo 'could not delete build lib'" | |
- name: Cleanup remote dist lib | |
if: always() | |
run: $ssh_command "system 'dltlib manzan'" | |
- name: Cleanup remote build dir | |
if: always() | |
run: $ssh_command "rm -fr $remote_build_dir" | |
- name: Cleanup remote stream file artifacts | |
if: always() | |
run: $ssh_command "rm -fr /QOpenSys/etc/manzan /opt/manzan" | |
- name: Create the release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ github.ref }} | |
draft: false | |
prerelease: false | |
- name: Upload *SAVF to release | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps | |
asset_path: ./manzan-installer-${{ github.ref_name }}.jar | |
asset_name: manzan-installer-${{ github.ref_name }}.jar | |
asset_content_type: application/zip |