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

Prep for release #12

Merged
merged 11 commits into from
Aug 2, 2024
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
21 changes: 21 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,24 @@ jobs:
-
name: Run fourmolu
run: fourmolu -m check $(git ls-files '*.hs')

build_sdist:
runs-on: ubuntu-latest
steps:
-
uses: actions/checkout@v3
-
id: setup
name: Set up GHC
uses: haskell-actions/setup@v2
-
name: Strip unreleased section from CHANGELOG
run: sed -i -n '/^## Unreleased/d; /^## /,$p' CHANGELOG.md
-
name: Create sdist bundle
run: cabal sdist --output-directory=.
-
uses: actions/upload-artifact@v3
with:
name: skeletest-sdist
path: skeletest-*.tar.gz
55 changes: 55 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Release
on: workflow_dispatch

jobs:
ci:
uses: ./.github/workflows/ci.yml

release:
runs-on: ubuntu-latest
needs:
- ci

steps:
-
uses: actions/checkout@v3
-
uses: actions/download-artifact@v3
with:
name: skeletest-sdist
path: ./sdist/
-
id: cabal_file
uses: haskell-actions/parse-cabal-file@v1
with:
cabal_file: skeletest.cabal
-
name: Set version label
run: echo 'VERSION=v${{ steps.cabal_file.outputs.version }}' >> "${GITHUB_ENV}"
-
id: hackage_token_secret
name: Load Hackage token secret name
run: |
USERNAME="$(echo "${GITHUB_ACTOR}" | tr '[:lower:]' '[:upper:]' | tr '-' '_')"
echo "name=HACKAGE_TOKEN_${USERNAME}" >> "${GITHUB_OUTPUT}"
-
name: Get CHANGELOG section
run: |
sed '/^## Unreleased/,/^$/d' CHANGELOG.md > /tmp/changelog-without-unreleased
if [[ "$(head -n 1 /tmp/changelog-without-unreleased)" != "## ${VERSION}" ]]; then
echo "CHANGELOG doesn't look updated" >&2
exit 1
fi
sed '1 d; /^## v/,$ d' /tmp/changelog-without-unreleased > /tmp/changelog-body
-
uses: haskell-actions/hackage-publish@v1
with:
hackageToken: ${{ secrets[steps.hackage_token_secret.outputs.name] }}
packagesPath: ./sdist/
-
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.VERSION }}
body_path: /tmp/changelog-body
draft: true
target_commitish: ${{ github.sha }}
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## Unreleased

## v0.1.0

Initial release
23 changes: 23 additions & 0 deletions DEVELOPER.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Release

Follow these steps to release this project:

1. Create a new branch
1. Bump version in `skeletest.cabal`
1. Curate `CHANGELOG.md`, creating a new section for this version and
moving everything previously in `Unreleased` into the new section
(keeping `Unreleased` as a section)
1. Add comments to new features indicating when it was added (e.g.
`-- @since v2.0.0`)
1. Run `cabal haddock` and skim through documentation

1. Create PR as usual and merge into `main`

1. Ensure your Hackage token is set in Settings > Secrets > Actions as `HACKAGE_TOKEN_<github_username>` (replace any non alphanumeric characters in username with `_`).
* Generate a token from `https://hackage.haskell.org/user/<hackage_username>/manage`

1. Go to the GitHub Actions page, click on the "Release" workflow, and click "Run workflow" on the main branch

1. Publish the candidate: https://hackage.haskell.org/package/skeletest/candidates

1. Publish the GitHub release: https://github.com/brandonchinn178/skeletest/releases
11 changes: 11 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Copyright © 2024-present Brandon Chinn

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Loading
Loading