From 44469e5ab05d77c5f4099272c0da2b21b54413a6 Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Fri, 15 Sep 2023 00:37:19 -0500 Subject: [PATCH] ci: update ci's with reusable release workflows --- .github/workflows/build.yml | 7 ++--- .github/workflows/nightly.yml | 51 +++++------------------------------ .github/workflows/release.yml | 20 +++----------- 3 files changed, 12 insertions(+), 66 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0cbd574..1309529 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,22 +3,19 @@ name: ⚙️ Build Binaries on: workflow_call: -env: - APP_NAME: ccnz - NIM_VERSION: stable - jobs: build-artifact: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + with: + fetch-depth: 0 - uses: jiro4989/setup-nim-action@v1 with: nim-version: ${{ env.NIM_VERSION }} - # for cross compilation with ccnz - uses: goto-bus-stop/setup-zig@v2 - name: Bootstrap with installed version diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index c505de8..9b8d5a9 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -10,52 +10,15 @@ permissions: jobs: check-commits: - runs-on: ubuntu-latest - name: Check latest commit - outputs: - quit: ${{ steps.should_run.outputs.quit }} - steps: - - uses: actions/checkout@v3 - - - name: print latest commit - run: echo ${{ github.sha }} - - - id: should_run - name: check latest commit is less than a day - if: ${{ github.event_name == 'schedule' }} - run: | - if [[ -n "$(git rev-list --since='24 hours' HEAD)" ]]; then - echo "quit=true" >> "$GITHUB_OUTPUT" - fi + uses: daylinmorgan/actions/.github/workflows/check-commits.yml@main + with: + since: "24 hours" build-artifacts: needs: check-commits if: ${{ needs.check-commits.outputs.quit != 'true' }} - uses: ./.github/workflows/build.yml - - create-release: - runs-on: ubuntu-latest - env: - GH_TOKEN: ${{ github.token }} - needs: - - build-artifacts - steps: - - uses: actions/checkout@v3 - - - name: Download Build Artifacts - uses: actions/download-artifact@v3 - - - run: ls -R artifacts - - - name: Remove Old Nightly Release - run: | - gh release delete nightly --yes || true - git push origin :nightly || true - - - name: Generate New Nightly Release - run: | - gh release create nightly \ - --title "Nightly Release (Pre-release)" \ - --prerelease \ - ./artifacts/* + uses: daylinmorgan/actions/.github/workflows/build-nim-forge.yml@main + generate-release: + needs: build-artifacts + uses: daylinmorgan/actions/.github/workflows/nightly.yml@main diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 935ea02..c4834b4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,22 +10,8 @@ permissions: jobs: build-artifacts: - uses: ./.github/workflows/build.yml + uses: daylinmorgan/actions/.github/workflows/build-nim-forge.yml@main create-release: - env: - GH_TOKEN: ${{ github.token }} - runs-on: ubuntu-latest - needs: - - build-artifacts - steps: - - uses: actions/checkout@v3 - - - name: Download Build Artifacts - uses: actions/download-artifact@v3 - - - run: ls -R artifacts/ - - - name: Generate New Nightly Release - run: | - gh release create ${{ github.ref }} ./artifacts/* + needs: build-artifacts + uses: daylinmorgan/actions/.github/workflows/release.yml@main