Skip to content

feat: v1.0.0! πŸŽ‰ #2

feat: v1.0.0! πŸŽ‰

feat: v1.0.0! πŸŽ‰ #2

Workflow file for this run

name: Release
on:
push:
tags:
- "*"
permissions:
actions: write
contents: write
jobs:
linux:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Crystal
uses: crystal-lang/install-crystal@v1
with:
crystal: latest
- name: Install Dependencies
run: shards install --production
- name: Compile Binaries
run: |
crystal build src/main.cr --no-debug --release -o crimson
tar -zcf crimson-${{ github.ref_name }}-linux-x86_64.tar.gz crimson
- name: Build Debian Package
run: |
RNAME=crimson_${{ github.ref_name }}-1_amd64
mkdir -p build/$RNAME/DEBIAN build/$RNAME/usr/bin
echo "Package: crimson
Version: ${{ github.ref_name }}
Maintainer: Devaune Whittle <https://github.com/devnote-dev>
Architecture: amd64
Homepage: https://github.com/crimson-crystal/crimson
Description: A Crystal Version Manager
" > build/$RNAME/DEBIAN/control
mv crimson build/$RNAME/usr/bin
dpkg --build build/$RNAME
mv build/$RNAME/usr/bin/crimson .
mv build/$RNAME.deb .
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: crimson-linux
path: |
crimson
crimson_${{ github.ref_name }}-1_amd64.deb
crimson-${{ github.ref_name }}-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: latest
- name: Install Dependencies
run: shards install --production
- name: Compile Binaries
run: |
crystal build src\main.cr --no-debug --release -o crimson.exe
$compress = @{
Path = "crimson.exe", "*.dll"
DestinationPath = "crimson-${{ github.ref_name }}-windows-x86_64-msvc.zip"
}
Compress-Archive @compress
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: crimson-windows
path: |
crimson.exe
crimson-${{ github.ref_name }}-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: crimson-*
merge-multiple: true
- name: Prepare Artifacts
run: |
mv artifacts/* .
sha256sum crimson crimson.exe > checksums.txt
- name: Create Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create ${{ github.ref_name }} -pt v${{ github.ref_name }}
gh release upload ${{ github.ref_name }} checksums.txt
gh release upload ${{ github.ref_name }} crimson_${{ github.ref_name }}-1_amd64.deb
gh release upload ${{ github.ref_name }} crimson-${{ github.ref_name }}-linux-x86_64.tar.gz
gh release upload ${{ github.ref_name }} crimson-${{ github.ref_name }}-windows-x86_64-msvc.zip