Skip to content

Commit

Permalink
Add release action
Browse files Browse the repository at this point in the history
  • Loading branch information
jakelyz committed Oct 8, 2024
1 parent 4037b14 commit 848f189
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: build release

on:
push:
tags:
- "v*.*.*"

jobs:
build:
name: builds
strategy:
matrix:
os: [ubuntu-latest, macOS-latest]

runs-on: ${{ matrix.os }}
steps:
- name: checkout
uses: actions/checkout@v4

- name: install D compiler
uses: dlang-community/setup-dlang@v2
with:
compiler: ldc
dub: latest

- name: build executable
shell: bash
run: ./release.sh

- name: release
uses: softprops/action-gh-release@v2
with:
files: releases/dtimer-*.tar.gz
15 changes: 15 additions & 0 deletions release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash

UNAME_OS="$(uname -s)"
arch="$(uname -m)"

mkdir -p releases

case "${UNAME_OS}" in
Linux*) os=linux;;
Darwin*) os=macos;;
*) os="${UNAME_OS}";;
esac

dub build -b release
tar czvf releases/dtimer-$os-$arch.tar.gz ./dtimer

0 comments on commit 848f189

Please sign in to comment.