Skip to content

Commit

Permalink
:Add draft workflow and simple Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Mejia committed Aug 21, 2023
1 parent 7c1d2c4 commit f1c054a
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# CI Workflows

## Overview

- [Build](build.yml)
- Build and test Haskell code
- [Draft](draft.yml)
- Create a GH draft release with a static binary
- [Release](release.yml)
- Upload the package and docs to Hackage (release candidate)

## Events

```mermaid
graph LR;
event[GH Event]-->|on push|Build;
event-->|tag created|Draft;
Draft-->|create draft release|End;
event-->|release published|Release;
Release-->|upload artifacts to Hackage (release candidate)|End;
Build-->End;
```
44 changes: 44 additions & 0 deletions .github/workflows/draft.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Release package to Github

on:
push:
tags:
- 'v*'

jobs:
build-binary:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- uses: addnab/docker-run-action@v3
with:
image: utdemir/ghc-musl:v24-ghc922
options: -v ${{ github.workspace }}:/mnt
run: |
cd /mnt
sh build.static.sh
- name: Change owner before compression
run: sudo chown $USER:$USER atomic-write

- name: Compress binary
uses: svenstaro/upx-action@v2
with:
file: atomic-write
args: --best --lzma
strip: true

- name: Rename binary file
run: cp atomic-write atomic-write-${{ github.ref_name }}-linux-x86_64-bin

- name: Create release with package assets
uses: softprops/action-gh-release@v1
with:
body_path: CHANGELOG.md
files: |
atomic-write-${{ github.ref_name }}-linux-x86_64-bin
draft: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit f1c054a

Please sign in to comment.