Skip to content

Commit 87f0865

Browse files
committed
docs: add semantic-release section
1 parent fa1f9d3 commit 87f0865

File tree

2 files changed

+77
-1
lines changed

2 files changed

+77
-1
lines changed

profile/README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,17 @@ The __haskell_github_trust__ account does not have upload permission, rather it
4747
on [hackage.haskell.org/upload](https://hackage.haskell.org/upload).
4848

4949
> #### Group Accounts
50-
>
50+
>
5151
> Occasionally organizations want to have a group / organizational account for a package that is maintained by a group of people. The recommended approach for these cases is to only do package uploads from individual accounts and use the group account only for managing the maintainer list for the package.
5252
5353
In this way you can [upload](https://hackage.haskell.org/upload) any package in this org.
5454

55+
## Organization secrets
56+
57+
Some organization secrets are setup to allow performing actions on the
58+
organization and publishing to Hackage. Check out the
59+
[`semantic-release`](semantic-release.md) file to learn more.
60+
5561
## How to add other people’s packages to the Trust
5662

5763
1. Follow the instructions in [Taking over a package](https://wiki.haskell.org/Taking_over_a_package) with your own Hackage account. Declare your intent to add the package to the Haskell GitHub Trust.

profile/semantic-release.mdx

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Setting up `semantic-release` for Haskell Github Trust packages
2+
3+
Once a version of your package has been uploaded to Hackage and the trust
4+
account has been added to the maintainers, you can use the [semantic-release
5+
action](https://github.com/cycjimmy/semantic-release-action) to publish new
6+
versions automatically. The organization already has everything configured, you
7+
only need to configure a few things.
8+
9+
In this example, we use the `stack-upload` plugin to upload to hackage, but feel
10+
free to use the `cabal` actions if you don't like `stack`. We also use `main` as
11+
the default branch, make sure to modify the snippets if you use a different
12+
default branch name.
13+
14+
## Install the Github App on your repository
15+
The first step is to add the [Github
16+
app](https://github.com/organizations/haskell-github-trust/settings/installations/79745966)
17+
to your repository by adding it to the selected repositories in `Repository access`
18+
19+
## Configure `semantic-release` in your repository
20+
In your repository at the root, configure `semantic-release`:
21+
22+
```javascript filename=".releaserc.mjs"
23+
/**
24+
* @type {import('semantic-release').GlobalConfig}
25+
*/
26+
export default {
27+
branches: ["main"],
28+
tagFormat: "${version}",
29+
plugins: [
30+
"semantic-release-stack-upload",
31+
]
32+
}
33+
```
34+
35+
## Add the `semantic-release` action to your repository
36+
```yaml filename=".github/workflows/semantic-release.yaml"
37+
---
38+
name: Semantic release
39+
on:
40+
push:
41+
branches:
42+
- main
43+
44+
jobs:
45+
build:
46+
name: Semantic release
47+
runs-on: ubuntu-latest
48+
steps:
49+
- uses: actions/checkout@v4
50+
with:
51+
persist-credentials: false
52+
53+
- uses: actions/create-github-app-token@v2
54+
id: app-token
55+
with:
56+
app-id: "${{ secrets.SEMANTIC_RELEASE_APP_ID }}"
57+
private-key: "${{ secrets.SEMANTIC_RELEASE_PRIVATE_KEY }}"
58+
59+
- name: Semantic release
60+
id: semantic
61+
uses: cycjimmy/semantic-release-action@v4
62+
env:
63+
GITHUB_TOKEN: "${{ steps.app-token.outputs.token }}"
64+
HACKAGE_KEY: "${{ secrets.HACKAGE_TOKEN }}"
65+
66+
with:
67+
ci: ${{ github.ref == github.event.repository.default_branch }}
68+
extra_plugins: |
69+
semantic-release-stack-upload
70+
```

0 commit comments

Comments
 (0)