Nightly #31
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Nightly | |
on: | |
# temporary | |
push: | |
tags: | |
- nightly | |
schedule: | |
# - cron: 0 6 * * 6 | |
- cron: 0 22 * * */2 | |
permissions: | |
actions: write | |
contents: write | |
env: | |
VERSION: 1.0.0 | |
jobs: | |
linux: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Crystal | |
uses: crystal-lang/install-crystal@v1 | |
with: | |
crystal: nightly | |
- name: Install Dependencies | |
run: shards install --production | |
- name: Compile Binaries | |
run: | | |
crystal build src/main.cr --debug -o docr | |
tar -zcf docr-${{ env.VERSION }}-nightly-linux-x86_64.tar.gz docr | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: docr-linux | |
path: | | |
docr | |
docr-${{ env.VERSION }}-nightly-linux-x86_64.tar.gz | |
windows: | |
needs: linux | |
runs-on: windows-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Crystal | |
uses: crystal-lang/install-crystal@v1 | |
with: | |
crystal: nightly | |
- name: Install Dependencies | |
run: shards install --production | |
- name: Compile Binaries | |
run: | | |
crystal build src\main.cr --debug -o docr.exe | |
$compress = @{ | |
Path = "docr.exe", "docr.pdb", "*.dll" | |
DestinationPath = "docr-${{ env.VERSION }}-nightly-windows-x86_64-msvc.zip" | |
} | |
Compress-Archive @compress | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: docr-windows | |
path: | | |
docr.exe | |
docr.pdb | |
docr-${{ env.VERSION }}-nightly-windows-x86_64-msvc.zip | |
release: | |
needs: windows | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Download Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: artifacts/ | |
pattern: docr-* | |
merge-multiple: true | |
- name: Prepare Artifacts | |
run: | | |
mv artifacts/* . | |
sha256sum docr docr.exe docr.pdb > checksums.txt | |
- name: Create Release | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh release view nightly &>/dev/null && gh release delete nightly -y | |
gh release create nightly -pt Nightly --notes "Nightly release for v${{ env.VERSION }} ($(date +%F))." | |
gh release upload nightly checksums.txt | |
gh release upload nightly docr-${{ env.VERSION }}-nightly-linux-x86_64.tar.gz | |
gh release upload nightly docr-${{ env.VERSION }}-nightly-windows-x86_64-msvc.zip |