Skip to content

Commit

Permalink
chore: Add semantic release config (#199)
Browse files Browse the repository at this point in the history
* chore: Include releaserc file

* chore(ci): Remove version from cabal file

* fix(ci): Remove unused branch from releaserc file
  • Loading branch information
aloussase authored Oct 31, 2024
1 parent c2c3e8d commit 226cc94
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 1 deletion.
38 changes: 38 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Release
on:
push:
branches:
- main
jobs:
release:
name: "Release"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
# Workaround for issue: https://github.com/cycjimmy/semantic-release-action/issues/159
# Had to pin to version 14
- name: "Pin node version"
uses: actions/setup-node@v2
with:
node-version: '14'
# Use haskell environment to run cabal configure needed for semantic-release-hackage
- name: Setup Haskell
id: setup-haskell-cabal
uses: haskell-actions/setup@v2
with:
ghc-version: "9.0"
cabal-version: "3.8"
- name: Semantic Release
run: cabal configure --enable-tests
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v4
with:
extra_plugins: |
@semantic-release/commit-analyzer
@semantic-release/release-notes-generator
@semantic-release/github
semantic-release-hackage@1.1.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HACKAGE_TOKEN: ${{ secrets.HACKAGE_TOKEN }}
18 changes: 18 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"$schema": "https://json.schemastore.org/semantic-release",
"branches": ["main"],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"semantic-release-hackage",
{
"packageName": "dotenv",
"versionPrefix": "0.",
"publishDocumentation": true
}
],
"@semantic-release/github"
],
"tagFormat": "v0.${version}"
}
2 changes: 1 addition & 1 deletion dotenv.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: dotenv
version: 0.12.0.0
version: 0.0.0.0
synopsis: Loads environment variables from dotenv files
homepage: https://github.com/stackbuilders/dotenv-hs
description:
Expand Down

0 comments on commit 226cc94

Please sign in to comment.