Skip to content

Commit

Permalink
Migrate to GitHub actions (#31)
Browse files Browse the repository at this point in the history
* Add build workflow for GH to repo

* :Add draft workflow and simple Readme

* Update draft workflow to not  include binaries

---------

Co-authored-by: Alexander Mejia <[email protected]>
  • Loading branch information
Alex0jk and Alexander Mejia authored Aug 29, 2023
1 parent 75aad6f commit f71cc5f
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 1 deletion.
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;
```
21 changes: 21 additions & 0 deletions .github/workflows/draft.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Release package to Github

on:
push:
tags:
- 'v*'

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

- name: Create release
uses: softprops/action-gh-release@v1
with:
body_path: CHANGELOG.md
draft: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25 changes: 25 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# The present workflow was made based on the following references:
# - https://github.com/tfausak/strive/blob/main/.github/workflows/ci.yaml
# - https://hackage.haskell.org/upload
---
name: Release

on:
release:
types:
- published

concurrency:
group: release-${{ github.ref }}
cancel-in-progress: true

jobs:
cabal-upload:
uses: stackbuilders/reusable-workflows/.github/workflows/cabal-upload.yml@main
with:
ghc_version: "8.10"
cabal_version: "3.6"
ignore_uploaded_package: true
secrets:
HACKAGE_USERNAME: ${{ secrets.HACKAGE_USERNAME }}
HACKAGE_PASSWORD: ${{ secrets.HACKAGE_PASSWORD }}
2 changes: 1 addition & 1 deletion atomic-write.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ test-suite atomic-write-test
, text
, bytestring >= 0.10.4
, hspec

build-tools: hspec-discover >= 2.0 && < 3.0

default-language: Haskell2010
Expand Down

0 comments on commit f71cc5f

Please sign in to comment.