-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
:Add draft workflow and simple Readme
- Loading branch information
Alexander Mejia
committed
Aug 21, 2023
1 parent
7c1d2c4
commit f1c054a
Showing
2 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
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
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; | ||
``` |
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
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 }} |