mirror of
https://github.com/daylinmorgan/forge.git
synced 2024-11-24 00:40:45 -06:00
ci: update ci's with reusable release workflows
This commit is contained in:
parent
ad33888072
commit
44469e5ab0
3 changed files with 12 additions and 66 deletions
7
.github/workflows/build.yml
vendored
7
.github/workflows/build.yml
vendored
|
@ -3,22 +3,19 @@ name: ⚙️ Build Binaries
|
||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
|
|
||||||
env:
|
|
||||||
APP_NAME: ccnz
|
|
||||||
NIM_VERSION: stable
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-artifact:
|
build-artifact:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
- uses: jiro4989/setup-nim-action@v1
|
- uses: jiro4989/setup-nim-action@v1
|
||||||
with:
|
with:
|
||||||
nim-version: ${{ env.NIM_VERSION }}
|
nim-version: ${{ env.NIM_VERSION }}
|
||||||
|
|
||||||
# for cross compilation with ccnz
|
|
||||||
- uses: goto-bus-stop/setup-zig@v2
|
- uses: goto-bus-stop/setup-zig@v2
|
||||||
|
|
||||||
- name: Bootstrap with installed version
|
- name: Bootstrap with installed version
|
||||||
|
|
51
.github/workflows/nightly.yml
vendored
51
.github/workflows/nightly.yml
vendored
|
@ -10,52 +10,15 @@ permissions:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check-commits:
|
check-commits:
|
||||||
runs-on: ubuntu-latest
|
uses: daylinmorgan/actions/.github/workflows/check-commits.yml@main
|
||||||
name: Check latest commit
|
with:
|
||||||
outputs:
|
since: "24 hours"
|
||||||
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
|
|
||||||
|
|
||||||
build-artifacts:
|
build-artifacts:
|
||||||
needs: check-commits
|
needs: check-commits
|
||||||
if: ${{ needs.check-commits.outputs.quit != 'true' }}
|
if: ${{ needs.check-commits.outputs.quit != 'true' }}
|
||||||
uses: ./.github/workflows/build.yml
|
uses: daylinmorgan/actions/.github/workflows/build-nim-forge.yml@main
|
||||||
|
|
||||||
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/*
|
|
||||||
|
|
||||||
|
generate-release:
|
||||||
|
needs: build-artifacts
|
||||||
|
uses: daylinmorgan/actions/.github/workflows/nightly.yml@main
|
||||||
|
|
20
.github/workflows/release.yml
vendored
20
.github/workflows/release.yml
vendored
|
@ -10,22 +10,8 @@ permissions:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-artifacts:
|
build-artifacts:
|
||||||
uses: ./.github/workflows/build.yml
|
uses: daylinmorgan/actions/.github/workflows/build-nim-forge.yml@main
|
||||||
|
|
||||||
create-release:
|
create-release:
|
||||||
env:
|
needs: build-artifacts
|
||||||
GH_TOKEN: ${{ github.token }}
|
uses: daylinmorgan/actions/.github/workflows/release.yml@main
|
||||||
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/*
|
|
||||||
|
|
Loading…
Reference in a new issue