Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to GitHub actions #31

Merged
merged 3 commits into from
Aug 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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