From a55c1b8948b58d28890cf416bb6f4bf61138d68b Mon Sep 17 00:00:00 2001 From: sam bacha Date: Sun, 27 Feb 2022 22:39:41 -0800 Subject: [PATCH 1/7] ci(workflow): release inital workflow --- .github/workflows/ci.yml | 23 ------------ .github/workflows/release.yml | 66 +++++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+), 23 deletions(-) delete mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index c47b267..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: docker-install CI - -on: [push, pull_request] - -jobs: - test: - runs-on: ubuntu-latest - timeout-minutes: 5 - strategy: - matrix: - os: - - ubuntu:18.04 - - centos:7 - version: - - 19.03 - - "" - - steps: - - uses: actions/checkout@v2 - - name: Shellcheck - run: make shellcheck - - name: Check distribution - run: TEST_IMAGE=${{ matrix.os }} VERSION=${{ matrix.version }} make test diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..d975c7c --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,66 @@ +# GitHub Action Workflow +# this creates a tag release whenever a tag is created +name: release + +on: + push: + tags: + - "*" + +jobs: + publish: + name: Publish for ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + include: + - os: ubuntu-latest + asset_name: foundryup-installer + artifact_name: foundryup + archive_ext: .sh + steps: + - uses: actions/checkout@v2 + with: + submodules: 'recursive' + + - name: Install packages (macOS) + if: matrix.os == 'macos-latest' + shell: bash + run: | + brew install coreutils + + + - name: Archive release assets + if: matrix.os != 'windows-latest' + id: archive_release_assets_unix_like + shell: bash + run: | + make + cp target/release/${{ matrix.artifact_name }} ${{ matrix.asset_name }} + cp build/* ${{ matrix.asset_name }} + tar -czvf ${{ matrix.asset_name }}${{ matrix.archive_ext }} ${{ matrix.asset_name }} + + - name: Generate SHA256 checksum for binary + if: matrix.os != 'windows-latest' + id: checksum_archive_unix_like + shell: bash + run: | + sha256sum ${{ matrix.asset_name }}${{ matrix.archive_ext }} > ${{ matrix.asset_name }}${{ matrix.archive_ext }}.sha256 + - name: Upload binary to release + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: ${{ matrix.asset_name }}${{ matrix.archive_ext }} + asset_name: ${{ matrix.asset_name }}${{ matrix.archive_ext }} + tag: ${{ github.ref }} + overwrite: true + + - name: Upload SHA256 checksum to release + if: matrix.os != 'windows-latest' + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: ${{ matrix.asset_name }}${{ matrix.archive_ext }}.sha256 + asset_name: ${{ matrix.asset_name }}${{ matrix.archive_ext }}.sha256 + tag: ${{ github.ref }} + overwrite: true From 526da0149cd55210fccdb3e9251c1bf08ebbeeb6 Mon Sep 17 00:00:00 2001 From: sam bacha Date: Sun, 27 Feb 2022 22:43:24 -0800 Subject: [PATCH 2/7] fix(ci): update workflow on push --- .github/workflows/release.yml | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d975c7c..2340edd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,10 +2,7 @@ # this creates a tag release whenever a tag is created name: release -on: - push: - tags: - - "*" +on: [push, repository_dispatch] jobs: publish: @@ -17,17 +14,19 @@ jobs: - os: ubuntu-latest asset_name: foundryup-installer artifact_name: foundryup - archive_ext: .sh + archive_ext: .* steps: - uses: actions/checkout@v2 with: submodules: 'recursive' - - - name: Install packages (macOS) - if: matrix.os == 'macos-latest' + persist-credentials: false + + - name: Install packages (ubuntu-latest) + if: matrix.os == 'ubuntu-latest' shell: bash run: | - brew install coreutils + make + bash build/install - name: Archive release assets From 0e76c9447bc2c6449ca48f47329a0497bbf189c3 Mon Sep 17 00:00:00 2001 From: sam bacha Date: Sun, 27 Feb 2022 22:47:24 -0800 Subject: [PATCH 3/7] build(ci): configure dir --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2340edd..33dd230 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,6 +25,7 @@ jobs: if: matrix.os == 'ubuntu-latest' shell: bash run: | + rm -rf build/ || { exit 1 && echo "[FAIL]: build dir"; } make bash build/install From 4bdbd75e19769fd5ad0842db898ddea5ea2c4bef Mon Sep 17 00:00:00 2001 From: sam bacha Date: Sun, 27 Feb 2022 22:48:49 -0800 Subject: [PATCH 4/7] fix(ci): archive ci output --- .github/workflows/release.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 33dd230..ddfc515 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -36,8 +36,7 @@ jobs: shell: bash run: | make - cp target/release/${{ matrix.artifact_name }} ${{ matrix.asset_name }} - cp build/* ${{ matrix.asset_name }} + cp build/${{ matrix.artifact_name }} ${{ matrix.asset_name }} tar -czvf ${{ matrix.asset_name }}${{ matrix.archive_ext }} ${{ matrix.asset_name }} - name: Generate SHA256 checksum for binary From 3ccd42eb57891d5ce1c87ff730048cd1d42d5004 Mon Sep 17 00:00:00 2001 From: sam bacha Date: Sun, 27 Feb 2022 22:50:25 -0800 Subject: [PATCH 5/7] ci(workflow): artifact name and ext use '' for empty string for ext --- .github/workflows/release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ddfc515..f1b2d96 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,9 +12,9 @@ jobs: matrix: include: - os: ubuntu-latest - asset_name: foundryup-installer - artifact_name: foundryup - archive_ext: .* + asset_name: foundryup + artifact_name: install + archive_ext: '' steps: - uses: actions/checkout@v2 with: From 9546c9d2807e9e36c6fc078b10a76969f7d0f5bf Mon Sep 17 00:00:00 2001 From: sam bacha Date: Sun, 27 Feb 2022 22:51:24 -0800 Subject: [PATCH 6/7] fix(ci): phantom --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f1b2d96..cf0b7ef 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,7 +14,7 @@ jobs: - os: ubuntu-latest asset_name: foundryup artifact_name: install - archive_ext: '' + archive_ext: .* steps: - uses: actions/checkout@v2 with: From d13b6b6efae0c9da997458d9deb36625f98eb39a Mon Sep 17 00:00:00 2001 From: sam bacha Date: Sun, 27 Feb 2022 22:54:01 -0800 Subject: [PATCH 7/7] docs(readme): init --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..ad28247 --- /dev/null +++ b/README.md @@ -0,0 +1,15 @@ +# `foundryup.secured` + +[![release](https://github.com/sambacha/foundryup-tests/actions/workflows/release.yml/badge.svg)](https://github.com/sambacha/foundryup-tests/actions/workflows/release.yml) + +--- + +## Overview + +* CI process for automating hash commit for verifying and versioning shell install script +* `Makefile` +* CD for creating release dist + +## License + +ISC