ci: add starter gh actions

This commit is contained in:
Daylin Morgan 2023-09-05 16:49:29 -05:00
parent 92b5f056c9
commit 4633b5b01c
Signed by: daylin
GPG key ID: C1E52E7DD81DF79F
4 changed files with 165 additions and 0 deletions

33
.github/workflows/build.yml vendored Normal file
View file

@ -0,0 +1,33 @@
name: ⚙️ Build Binaries
on:
workflow_call:
jobs:
build-artifact:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- 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: Generate build artifacts
run: nimble release
- name: Create artifact bundles
run: nimble bundle
- uses: actions/upload-artifact@v3
with:
name: artifacts
path: |
dist/*.tar.gz
dist/*.zip

60
.github/workflows/nightly.yml vendored Normal file
View file

@ -0,0 +1,60 @@
name: 🌙 Nightly Release
on:
workflow_dispatch:
schedule:
- cron: '0 2 * * *'
permissions:
contents: write
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: |
test -n "$(git rev-list --since="24 hours" HEAD)" \
&& echo "quit=true" >> "$GITHUB_OUTPUT"
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/*

31
.github/workflows/release.yml vendored Normal file
View file

@ -0,0 +1,31 @@
name: 🚀 Release
on:
push:
tags:
- 'v*.*'
permissions:
contents: write
jobs:
build-artifacts:
uses: ./.github/workflows/build.yml
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/*

41
nimble.lock Normal file
View file

@ -0,0 +1,41 @@
{
"version": 2,
"packages": {
"cligen": {
"version": "1.6.14",
"vcsRevision": "bee21f2d0878d4eba4631fd8b67370e4778424de",
"url": "https://github.com/c-blake/cligen.git",
"downloadMethod": "git",
"dependencies": [],
"checksums": {
"sha1": "195164d6a417c5393ee8aac1d1c2dfb0d45574b1"
}
},
"illwill": {
"version": "0.3.1",
"vcsRevision": "2fe96f5c5a6e216e84554d92090ce3d47460667a",
"url": "https://github.com/johnnovak/illwill",
"downloadMethod": "git",
"dependencies": [],
"checksums": {
"sha1": "ecec6c88a8f0d7e06e4ca6a4405206845357e737"
}
}
},
"tasks": {
"release": {
"ccnz": {
"version": "2023.1001",
"vcsRevision": "3353d2c6fb957c72fda6ba798ca50d771159e12a",
"url": "https://github.com/daylinmorgan/ccnz",
"downloadMethod": "git",
"dependencies": [
"cligen"
],
"checksums": {
"sha1": "405eeb87767929090d8c81ff04a08e639bacb117"
}
}
}
}
}