Skip to content

Commit

Permalink
added github action
Browse files Browse the repository at this point in the history
  • Loading branch information
imagineeeinc committed Jun 20, 2024
1 parent 52cd4bf commit a9bf1a5
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 1 deletion.
50 changes: 50 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Deploy Nightly
on:
schedule:
- cron: '0 20 * * *'
workflow_dispatch:

jobs:
check-commits:
runs-on: windows-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Install Nim
- uses: iffy/install-nim@v5
with:
version: binary:2.0.2

- name: Set up PowerShell
shell: pwsh

- name: Check for commits today
id: check_commits
run: |
# Get the current date in YYYY-MM-DD format
$today = (Get-Date).ToString("yyyy-MM-dd")
# Get the list of commits for today
$commits = git log --since="$today 00:00:00" --until="$today 23:59:59" --pretty=format:"%H"
# If there are no commits, set the output to 'false'
if (-not $commits) {
echo "::set-output name=commits_present::false"
} else {
echo "::set-output name=commits_present::true"
}
- name: Run Build if Commits Present
if: steps.check_commits.outputs.commits_present == 'true'
run: |
echo "Commits were found for today. Running build script..."
./build.ps1
- name: Upload Build Artifact
if: steps.check_commits.outputs.commits_present == 'true'
uses: actions/upload-artifact@v3
with:
name: lychee-build-windows
path: lychee-build-win.zip
2 changes: 1 addition & 1 deletion build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ cd ..
$compress = @{
Path = "./lychee.exe", "assembler/lasm.exe", "docs", "examples", "README.md", "lychee.png"
CompressionLevel = "Fastest"
DestinationPath = "lychee-build.zip"
DestinationPath = "lychee-build-win.zip"
}
Compress-Archive @compress
Binary file removed lychee-build.zip
Binary file not shown.

0 comments on commit a9bf1a5

Please sign in to comment.