You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* added an explanation on how to automatically update a projects Resource Page
* minor spelling mistake
* refactor: cleanup
---------
Co-authored-by: Matouš Kučera <mk@kcra.me>
After you have added the required `hangarPublish` configuration, you can manually publish it by
@@ -133,11 +133,50 @@ hangarPublish {
133
133
}
134
134
```
135
135
136
-
### Optional: Going deeper
136
+
##GitHub Actions workflow
137
137
138
-
With the following channels, any version that contains a hyphen (`-`) will be published under the `Snapshot` channel
139
-
that you need to create on Hangar. By editing the `channel.set(...)` line, you can change this to any channel you would
140
-
like. For example, you could further split builds depending on the branch you are currently on into `Alpha` builds.
138
+
You don't necessarily need to publish via GitHub Actions, but it is an easy way to do so. If you want to use it, create
139
+
a `publish.yml` file in the `.github/workflows` directory of your project root folder and make sure
140
+
you [add the repository secret](#adding-the-hangar_api_token-repository-secret).
141
+
142
+
You can add and remove branches to be published by editing the `branches` section.
143
+
144
+
```yaml
145
+
name: Publish to Hangar
146
+
on:
147
+
push:
148
+
branches:
149
+
# Add any additional branches you want to automatically publish from
150
+
- main # Assuming your main branch is called 'main'
151
+
152
+
jobs:
153
+
publish:
154
+
# TODO: Optional, make sure the task only runs on pushes to your repository and doesn't fail on forks. Uncomment the line below and put the repo owner into the quotes
## Optional: Handling multiple channels and an automatic changelog
175
+
176
+
With the following code, any version that contains a hyphen (`-`) will be published under the `Snapshot` channel
177
+
(that you need to create on Hangar) and the others on the `Release` channel.
178
+
By editing the `channel.set(...)` line, you can change this to any channel you would like.
179
+
For example, you could further split builds depending on the branch you are currently on into `Alpha` builds.
141
180
142
181
:::caution
143
182
@@ -188,40 +227,29 @@ hangarPublish {
188
227
}
189
228
```
190
229
191
-
### GitHub Actions workflow
230
+
##Optional: Updating the resource page
192
231
193
-
You don't necessarily need to publish via GitHub Actions, but it is an easy way to do so. If you want to use it, create
194
-
a `publish.yml` file in the `.github/workflows` directory of your project root folder and make sure
195
-
you [add the repository secret](#adding-the-hangar_api_token-repository-secret).
232
+
A notable part of publishing a new version might be updating the resource page (e.g. the plugin's home page) with new content from your plugin's repository.
196
233
197
-
You can add and remove branches to be published by editing the `branches` section.
234
+
In this example, we're using a README file, but you can use any text you want, as long as it is in Markdown format.
198
235
199
-
```yaml
200
-
name: Publish to Hangar
201
-
on:
202
-
push:
203
-
branches:
204
-
# Add any additional branches you want to automatically publish from
205
-
- main # Assuming your main branch is called 'main'
236
+
```kotlin
237
+
val pageContent = project.file("README.md").readText()
206
238
207
-
jobs:
208
-
publish:
209
-
# TODO: Optional, make sure the task only runs on pushes to your repository and doesn't fail on forks. Uncomment the line below and put the repo owner into the quotes
0 commit comments