Compare commits

...

17 commits
v2.8.0 ... main

Author SHA1 Message Date
Renovate Bot 6c747b97f9
Update https://code.forgejo.org/actions/setup-forgejo action to v3.1.4 (#139)
Reviewed-on: https://code.forgejo.org/actions/forgejo-release/pulls/139
Co-authored-by: Renovate Bot <bot@kriese.eu>
Co-committed-by: Renovate Bot <bot@kriese.eu>
2026-02-10 15:23:55 +00:00
nihklas 8fb94f88a4
feat: release notes from file (#141)
Reviewed-on: https://code.forgejo.org/actions/forgejo-release/pulls/141
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: nihklas <nihklas@noreply.code.forgejo.org>
Co-committed-by: nihklas <nihklas@noreply.code.forgejo.org>
2026-02-10 15:23:36 +00:00
Renovate Bot 94a60cb661
Update dependency forgejo/release-notes-assistant to v1.5.2 (#140)
Reviewed-on: https://code.forgejo.org/actions/forgejo-release/pulls/140
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Renovate Bot <bot@kriese.eu>
Co-committed-by: Renovate Bot <bot@kriese.eu>
2026-02-06 06:00:25 +00:00
Renovate Bot b5fa0f2e61
Update dependency actions/forgejo-release to v2.9.1 (#135)
Reviewed-on: https://code.forgejo.org/actions/forgejo-release/pulls/135
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Renovate Bot <bot@kriese.eu>
Co-committed-by: Renovate Bot <bot@kriese.eu>
2026-02-02 05:53:09 +00:00
Renovate Bot 21f672cae6 Update https://code.forgejo.org/actions/setup-forgejo action to v3.1.3 (#138)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [https://code.forgejo.org/actions/setup-forgejo](https://code.forgejo.org/actions/setup-forgejo) | action | patch | `v3.1.2` → `v3.1.3` |

---

### Release Notes

<details>
<summary>actions/setup-forgejo (https://code.forgejo.org/actions/setup-forgejo)</summary>

### [`v3.1.3`](https://code.forgejo.org/actions/setup-forgejo/releases/tag/v3.1.3)

[Compare Source](https://code.forgejo.org/actions/setup-forgejo/compare/v3.1.2...v3.1.3)

<!--start release-notes-assistant-->

<!--URL:https://code.forgejo.org/actions/setup-forgejo-->

- other
  - [PR](https://code.forgejo.org/actions/setup-forgejo/pulls/860): <!--number 860 --><!--line 0 --><!--description VXBkYXRlIGRlcGVuZGVuY3kgZm9yZ2Vqby9ydW5uZXIgdG8gdjEyLjYuMg==-->Update dependency forgejo/runner to v12.6.2<!--description-->

<!--end release-notes-assistant-->

</details>

---

### Configuration

📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC), Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi45Mi40IiwidXBkYXRlZEluVmVyIjoiNDIuOTIuNCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Reviewed-on: https://code.forgejo.org/actions/forgejo-release/pulls/138
Reviewed-by: Mathieu Fenniak <mfenniak@noreply.code.forgejo.org>
Co-authored-by: Renovate Bot <bot@kriese.eu>
Co-committed-by: Renovate Bot <bot@kriese.eu>
2026-01-26 05:24:08 +00:00
Renovate Bot 454bc2681f Update https://code.forgejo.org/actions/setup-forgejo action to v3.1.2 (#137)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [https://code.forgejo.org/actions/setup-forgejo](https://code.forgejo.org/actions/setup-forgejo) | action | patch | `v3.1.1` → `v3.1.2` |

---

### Release Notes

<details>
<summary>actions/setup-forgejo (https://code.forgejo.org/actions/setup-forgejo)</summary>

### [`v3.1.2`](https://code.forgejo.org/actions/setup-forgejo/releases/tag/v3.1.2)

[Compare Source](https://code.forgejo.org/actions/setup-forgejo/compare/v3.1.1...v3.1.2)

<!--start release-notes-assistant-->

<!--URL:https://code.forgejo.org/actions/setup-forgejo-->

- other
  - [PR](https://code.forgejo.org/actions/setup-forgejo/pulls/852): <!--number 852 --><!--line 0 --><!--description VXBkYXRlIGRlcGVuZGVuY3kgZm9yZ2Vqby9ydW5uZXIgdG8gdjEyLjYuMQ==-->Update dependency forgejo/runner to v12.6.1<!--description-->
  - [PR](https://code.forgejo.org/actions/setup-forgejo/pulls/846): <!--number 846 --><!--line 0 --><!--description VXBkYXRlIGRlcGVuZGVuY3kgZm9yZ2Vqby9ydW5uZXIgdG8gdjEyLjYuMA==-->Update dependency forgejo/runner to v12.6.0<!--description-->

<!--end release-notes-assistant-->

</details>

---

### Configuration

📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC), Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi44NS4zIiwidXBkYXRlZEluVmVyIjoiNDIuODUuMyIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Reviewed-on: https://code.forgejo.org/actions/forgejo-release/pulls/137
Reviewed-by: Mathieu Fenniak <mfenniak@noreply.code.forgejo.org>
Co-authored-by: Renovate Bot <bot@kriese.eu>
Co-committed-by: Renovate Bot <bot@kriese.eu>
2026-01-24 02:44:02 +00:00
Renovate Bot 4b5fdf8538
Replace code.forgejo.org/forgejo/forgejo Docker tag with data.forgejo.org/forgejo/forgejo (#136)
Reviewed-on: https://code.forgejo.org/actions/forgejo-release/pulls/136
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Renovate Bot <bot@kriese.eu>
Co-committed-by: Renovate Bot <bot@kriese.eu>
2026-01-23 08:58:26 +00:00
Michael Kriese 5c6400d871
fix: use proper comparison (#133)
Reviewed-on: https://code.forgejo.org/actions/forgejo-release/pulls/133
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Co-committed-by: Michael Kriese <michael.kriese@visualon.de>
2026-01-22 17:37:36 +00:00
Renovate Bot a1314c9c65
Update dependency actions/forgejo-release to v2.9.0 (#134)
Reviewed-on: https://code.forgejo.org/actions/forgejo-release/pulls/134
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Renovate Bot <bot@kriese.eu>
Co-committed-by: Renovate Bot <bot@kriese.eu>
2026-01-22 05:49:19 +00:00
Michael Kriese 7fdceaa4f8
ci: fix action path conflict on release (#132)
Reviewed-on: https://code.forgejo.org/actions/forgejo-release/pulls/132
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Co-committed-by: Michael Kriese <michael.kriese@visualon.de>
2026-01-21 09:58:40 +00:00
Michael Kriese 2c623db48b
ci: don't run on tags (#131)
Reviewed-on: https://code.forgejo.org/actions/forgejo-release/pulls/131
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Co-committed-by: Michael Kriese <michael.kriese@visualon.de>
2026-01-21 09:46:10 +00:00
Michael Kriese 5abb3c3dd1
ci: create release notes (#130)
Reviewed-on: https://code.forgejo.org/actions/forgejo-release/pulls/130
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Co-committed-by: Michael Kriese <michael.kriese@visualon.de>
2026-01-21 09:41:45 +00:00
Michael Kriese 1e356ba621
docs: lint and fix (#129)
Reviewed-on: https://code.forgejo.org/actions/forgejo-release/pulls/129
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Co-committed-by: Michael Kriese <michael.kriese@visualon.de>
2026-01-21 09:38:02 +00:00
Michael Kriese b93b6e8f70
feat: allow skipping upload assets (#128)
Reviewed-on: https://code.forgejo.org/actions/forgejo-release/pulls/128
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Co-committed-by: Michael Kriese <michael.kriese@visualon.de>
2026-01-21 09:25:14 +00:00
Renovate Bot f5b4441975
Update https://code.forgejo.org/actions/setup-forgejo action to v3.1.1 (#127)
Reviewed-on: https://code.forgejo.org/actions/forgejo-release/pulls/127
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Renovate Bot <bot@kriese.eu>
Co-committed-by: Renovate Bot <bot@kriese.eu>
2026-01-19 05:56:01 +00:00
Renovate Bot 50cc69b340
Update dependency actions/forgejo-release to v2.8.0 (#126)
Reviewed-on: https://code.forgejo.org/actions/forgejo-release/pulls/126
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Renovate Bot <bot@kriese.eu>
Co-committed-by: Renovate Bot <bot@kriese.eu>
2026-01-18 08:18:17 +00:00
Renovate Bot 5ce5ec1ef1
Update code.forgejo.org/forgejo/forgejo Docker tag to v11.0.10 (#125)
Reviewed-on: https://code.forgejo.org/actions/forgejo-release/pulls/125
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Renovate Bot <bot@kriese.eu>
Co-committed-by: Renovate Bot <bot@kriese.eu>
2026-01-18 08:13:54 +00:00
14 changed files with 237 additions and 31 deletions

View file

@ -1,9 +1,11 @@
on: [ pull_request, push ] on:
pull_request:
push:
branches:
- "**"
env: env:
FORGEJO_VERSION: 11.0.9 # renovate: datasource=docker depName=code.forgejo.org/forgejo/forgejo FORGEJO_VERSION: 11.0.10 # renovate: datasource=docker depName=data.forgejo.org/forgejo/forgejo
jobs: jobs:
integration: integration:
@ -12,7 +14,7 @@ jobs:
- uses: actions/checkout@v6 - uses: actions/checkout@v6
- id: forgejo - id: forgejo
uses: https://code.forgejo.org/actions/setup-forgejo@v3.1.0 uses: https://code.forgejo.org/actions/setup-forgejo@v3.1.4
with: with:
user: testuser user: testuser
password: admin1234 password: admin1234
@ -46,6 +48,37 @@ jobs:
test $(cat /tmp/v1.json | jq -r .hide_archive_links) = true test $(cat /tmp/v1.json | jq -r .hide_archive_links) = true
- name: testdata/release-notes-file
run: |
export LOOP_DELAY=30
export FORGEJO_RUNNER_LOGS="${{ steps.forgejo.outputs.runner-logs }}"
forgejo-test-helper.sh run_workflow testdata/release-notes-file http://testuser:admin1234@${{ steps.forgejo.outputs.host-port }} testuser release-notes-file forgejo-release "${{ steps.forgejo.outputs.token }}"
set -ex
export FORGEJO="${{ steps.forgejo.outputs.url }}"
curl --fail -sS $FORGEJO/api/v1/repos/testuser/release-notes-file/releases/tags/v1.0 > /tmp/v1.json
curl --fail -sS $FORGEJO/api/v1/repos/testuser/release-notes-file/releases/tags/v2.0 > /tmp/v2.json
curl --fail -sS $FORGEJO/api/v1/repos/testuser/release-notes-file/releases/tags/v3.0 > /tmp/v3.json
EXPECTED='# This is a Release Note
Some *formatted*,
multiline
Markdown content.
```bash
echo "Even a code block"
```'
test "$EXPECTED" = "$(jq -r .body < /tmp/v1.json)"
test "$EXPECTED" = "$(jq -r .body < /tmp/v2.json)"
test "I wont be there" != "$(jq -r .body < /tmp/v2.json)"
test "$EXPECTED" != "$(jq -r .body < /tmp/v3.json)"
test "I will be there" = "$(jq -r .body < /tmp/v3.json)"
- name: testdata/upload-download-private - name: testdata/upload-download-private
run: | run: |
export LOOP_DELAY=30 export LOOP_DELAY=30
@ -68,7 +101,7 @@ jobs:
testdata/forgejo-release-test.sh test_run testuser otherrepo testdata/forgejo-release-test.sh test_run testuser otherrepo
- if: always() - if: always()
name: '[RUNNER] and [FORGEJO] logs' name: "[RUNNER] and [FORGEJO] logs"
run: | run: |
runner_logs="${{ steps.forgejo.outputs.runner-logs }}" runner_logs="${{ steps.forgejo.outputs.runner-logs }}"
if test -f "$runner_logs"; then if test -f "$runner_logs"; then

View file

@ -0,0 +1,23 @@
on:
push:
tags:
- v*
jobs:
publish:
runs-on: docker
steps:
# needs to be in a different dir, so binary and rna cache don't conflict
- uses: https://data.forgejo.org/actions/checkout@v6
with:
path: forgejo-release
- name: publish release
uses: ./forgejo-release
with:
direction: upload
override: ${{ vars.OVERRIDE || 'false' }}
verbose: ${{ vars.VERBOSE || 'false' }}
release-notes-assistant: true
skip-assets: true

View file

@ -1,10 +1,27 @@
on: [ pull_request, push ] on:
pull_request:
push:
branches:
- "**"
jobs: jobs:
tests: tests:
runs-on: docker runs-on: docker
container:
image: data.forgejo.org/oci/node:24-trixie
steps: steps:
- uses: actions/checkout@v6 - uses: actions/checkout@v6
- name: lint action-docs
run: |
npx --yes action-docs -u
git diff --quiet || {
echo "[ERROR] Please apply the changes action-docs suggests:"
git diff --color=always
exit 1
}
- name: Unit tests of the supporting script forgejo-release.sh - name: Unit tests of the supporting script forgejo-release.sh
run: | run: |
testdata/forgejo-release-test.sh test_system_tea_bin testdata/forgejo-release-test.sh test_system_tea_bin

View file

@ -10,14 +10,15 @@ Upload or download the assets of a release to a Forgejo instance.
| name | description | required | default | | name | description | required | default |
| --- | --- | --- | --- | | --- | --- | --- | --- |
| `url` | <p>URL of the Forgejo instance</p> | `false` | `${{ env.GITHUB_SERVER_URL }}` | | `url` | <p>URL of the Forgejo instance</p> | `false` | `${{ env.FORGEJO_SERVER_URL }}` |
| `repo` | <p>owner/project relative to the URL</p> | `false` | `${{ github.repository }}` | | `repo` | <p>owner/project relative to the URL</p> | `false` | `${{ forge.repository }}` |
| `tag` | <p>Tag of the release</p> | `false` | `${{ github.ref_name }}` | | `tag` | <p>Tag of the release</p> | `false` | `${{ forge.ref_name }}` |
| `title` | <p>Title of the release (defaults to tag)</p> | `false` | `""` | | `title` | <p>Title of the release (defaults to tag)</p> | `false` | `""` |
| `sha` | <p>SHA of the release</p> | `false` | `${{ github.sha }}` | | `sha` | <p>SHA of the release</p> | `false` | `${{ forge.sha }}` |
| `token` | <p>Forgejo application token (must have `write:repository`)</p> | `false` | `${{ secrets.GITHUB_TOKEN }}` | | `token` | <p>Forgejo application token (must have <code>write:repository</code>)</p> | `false` | `${{ forge.token }}` |
| `release-dir` | <p>Directory in whichs release assets are uploaded or downloaded</p> | `true` | `""` | | `release-dir` | <p>Directory in which release assets are uploaded or downloaded</p> | `false` | `dist/release` |
| `release-notes` | <p>Release notes</p> | `false` | `""` | | `release-notes` | <p>Release notes</p> | `false` | `""` |
| `release-notes-file` | <p>Path to a file containing your release notes (takes priority over <code>release-notes</code>)</p> | `false` | `""` |
| `direction` | <p>Can either be <code>download</code> or <code>upload</code></p> | `true` | `""` | | `direction` | <p>Can either be <code>download</code> or <code>upload</code></p> | `true` | `""` |
| `gpg-private-key` | <p>GPG Private Key to sign the release artifacts</p> | `false` | `""` | | `gpg-private-key` | <p>GPG Private Key to sign the release artifacts</p> | `false` | `""` |
| `gpg-passphrase` | <p>Passphrase of the GPG Private Key</p> | `false` | `""` | | `gpg-passphrase` | <p>Passphrase of the GPG Private Key</p> | `false` | `""` |
@ -28,6 +29,7 @@ Upload or download the assets of a release to a Forgejo instance.
| `prerelease` | <p>Mark Release as Pre-Release</p> | `false` | `false` | | `prerelease` | <p>Mark Release as Pre-Release</p> | `false` | `false` |
| `release-notes-assistant` | <p>Generate release notes with Release Notes Assistant</p> | `false` | `false` | | `release-notes-assistant` | <p>Generate release notes with Release Notes Assistant</p> | `false` | `false` |
| `hide-archive-link` | <p>Hide the archive links</p> | `false` | `false` | | `hide-archive-link` | <p>Hide the archive links</p> | `false` | `false` |
| `skip-assets` | <p>Skip uploading release assets</p> | `false` | `false` |
<!-- action-docs-inputs source="action.yml" --> <!-- action-docs-inputs source="action.yml" -->
## Examples ## Examples
@ -42,7 +44,7 @@ jobs:
runs-on: docker runs-on: docker
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: actions/forgejo-release@v2.7.3 - uses: actions/forgejo-release@v2.9.1
with: with:
direction: upload direction: upload
url: https://my-forgejo-instance.net url: https://my-forgejo-instance.net
@ -53,6 +55,27 @@ jobs:
release-notes: "MY RELEASE NOTES" release-notes: "MY RELEASE NOTES"
``` ```
Upload a release with custom release notes located in a file:
```yaml
jobs:
upload-release:
runs-on: docker
steps:
- uses: actions/checkout@v4
- name: Generate Changelog
run: ./generate-changelog.sh > dist/changelog.md
- uses: actions/forgejo-release@v2.7.3
with:
direction: upload
url: https://my-forgejo-instance.net
repo: myuser/myrepo
token: ${{ secrets.WRITE_TOKEN_TO_MYREPO }}
tag: v13.0.2
release-dir: dist/release
release-notes-file: dist/changelog.md
```
### Download ### Download
Example downloading the forgejo release v1.21.4-0 into the working directory: Example downloading the forgejo release v1.21.4-0 into the working directory:
@ -63,7 +86,7 @@ jobs:
runs-on: docker runs-on: docker
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: actions/forgejo-release@v2.7.3 - uses: actions/forgejo-release@v2.9.1
with: with:
direction: download direction: download
url: https://my-forgejo-instance.net url: https://my-forgejo-instance.net
@ -83,5 +106,5 @@ Using [action-docs](https://github.com/npalm/action-docs):
```shell ```shell
# Edit the action.yml file and run: # Edit the action.yml file and run:
action-docs --update-readme npx action-docs --update-readme
``` ```

View file

@ -19,13 +19,15 @@ inputs:
description: 'SHA of the release' description: 'SHA of the release'
default: '${{ forge.sha }}' default: '${{ forge.sha }}'
token: token:
description: 'Forgejo application token' description: 'Forgejo application token (must have `write:repository`)'
default: '${{ forge.token }}' default: '${{ forge.token }}'
release-dir: release-dir:
description: 'Directory in whichs release assets are uploaded or downloaded' description: 'Directory in which release assets are uploaded or downloaded'
required: true default: 'dist/release'
release-notes: release-notes:
description: 'Release notes' description: 'Release notes'
release-notes-file:
description: 'Path to a file containing your release notes (takes priority over `release-notes`)'
direction: direction:
description: 'Can either be `download` or `upload`' description: 'Can either be `download` or `upload`'
required: true required: true
@ -37,22 +39,25 @@ inputs:
description: 'Number of times to retry if the release is not ready (default 1)' description: 'Number of times to retry if the release is not ready (default 1)'
download-latest: download-latest:
description: 'Download the latest release' description: 'Download the latest release'
default: false default: 'false'
verbose: verbose:
description: 'Increase the verbosity level' description: 'Increase the verbosity level'
default: false default: 'false'
override: override:
description: 'Override an existing release by the same `{tag}`' description: 'Override an existing release by the same `{tag}`'
default: false default: 'false'
prerelease: prerelease:
description: 'Mark Release as Pre-Release' description: 'Mark Release as Pre-Release'
default: false default: 'false'
release-notes-assistant: release-notes-assistant:
description: 'Generate release notes with Release Notes Assistant' description: 'Generate release notes with Release Notes Assistant'
default: false default: 'false'
hide-archive-link: hide-archive-link:
description: 'Hide the archive links' description: 'Hide the archive links'
default: false default: 'false'
skip-assets:
description: Skip uploading release assets
default: 'false'
runs: runs:
using: "composite" using: "composite"
@ -97,6 +102,16 @@ runs:
EOF EOF
) )
RELEASENOTES_FILE="${{ inputs.release-notes-file }}"
if [ ! -z "$RELEASENOTES_FILE" ]; then
if [ ! -f "$RELEASENOTES_FILE" ]; then
echo "! Release notes file $RELEASENOTES_FILE does not exist."
exit 1
fi
export RELEASENOTES=$(cat "$RELEASENOTES_FILE")
fi
export SHA="${{ inputs.sha }}" export SHA="${{ inputs.sha }}"
export OVERRIDE="${{ inputs.override }}" export OVERRIDE="${{ inputs.override }}"
@ -113,5 +128,7 @@ runs:
echo -n "${{ inputs.gpg-passphrase }}" > $TMP_DIR/gpg-passphrase echo -n "${{ inputs.gpg-passphrase }}" > $TMP_DIR/gpg-passphrase
export GPG_PASSPHRASE="$TMP_DIR/gpg-passphrase" export GPG_PASSPHRASE="$TMP_DIR/gpg-passphrase"
export SKIP_ASSETS="${{ inputs.skip-assets }}"
forgejo-release.sh ${{ inputs.direction }} forgejo-release.sh ${{ inputs.direction }}
shell: bash shell: bash

View file

@ -18,8 +18,9 @@ if ${VERBOSE:-false}; then set -x; fi
: ${HIDE_ARCHIVE_LINK:=false} : ${HIDE_ARCHIVE_LINK:=false}
: ${RETRY:=1} : ${RETRY:=1}
: ${DELAY:=10} : ${DELAY:=10}
: ${SKIP_ASSETS:=false}
RELEASE_NOTES_ASSISTANT_VERSION=v1.5.1 # renovate: datasource=forgejo-releases depName=forgejo/release-notes-assistant registryUrl=https://code.forgejo.org RELEASE_NOTES_ASSISTANT_VERSION=v1.5.2 # renovate: datasource=forgejo-releases depName=forgejo/release-notes-assistant registryUrl=https://code.forgejo.org
TAG_FILE="$TMP_DIR/tag$$.json" TAG_FILE="$TMP_DIR/tag$$.json"
TAG_URL=$(echo "$TAG" | sed 's/\//%2F/g') TAG_URL=$(echo "$TAG" | sed 's/\//%2F/g')
@ -84,9 +85,11 @@ upload_release() {
# It is expanded using "${assets[@]}" which preserves the separation of arguments and not split whitespace containing values. # It is expanded using "${assets[@]}" which preserves the separation of arguments and not split whitespace containing values.
# For reference, see https://github.com/koalaman/shellcheck/wiki/SC2086#exceptions # For reference, see https://github.com/koalaman/shellcheck/wiki/SC2086#exceptions
local assets=() local assets=()
for file in "$RELEASE_DIR"/*; do if [ "$SKIP_ASSETS" == 'false' ]; then
assets=("${assets[@]}" -a "$file") for file in "$RELEASE_DIR"/*; do
done assets=("${assets[@]}" -a "$file")
done
fi
if $PRERELEASE || echo "${TAG}" | grep -qi '\-rc'; then if $PRERELEASE || echo "${TAG}" | grep -qi '\-rc'; then
releaseType="--prerelease" releaseType="--prerelease"
echo "Uploading as Pre-Release" echo "Uploading as Pre-Release"
@ -207,7 +210,7 @@ download() {
( (
mkdir -p $RELEASE_DIR mkdir -p $RELEASE_DIR
cd $RELEASE_DIR cd $RELEASE_DIR
if [[ ${DOWNLOAD_LATEST} == "true" ]]; then if [[ ${DOWNLOAD_LATEST} = "true" ]]; then
echo "Downloading the latest release" echo "Downloading the latest release"
api GET repos/$REPO/releases/latest >"$TMP_DIR"/assets.json api GET repos/$REPO/releases/latest >"$TMP_DIR"/assets.json
elif [[ ${DOWNLOAD_LATEST} == "false" ]]; then elif [[ ${DOWNLOAD_LATEST} == "false" ]]; then

View file

@ -16,7 +16,7 @@ jobs:
steps: steps:
- uses: actions/checkout@v6 - uses: actions/checkout@v6
- id: forgejo - id: forgejo
uses: https://code.forgejo.org/actions/setup-forgejo@v3.1.0 uses: https://code.forgejo.org/actions/setup-forgejo@v3.1.4
with: with:
user: testuser user: testuser
password: admin1234 password: admin1234

View file

@ -0,0 +1,44 @@
# SPDX-License-Identifier: MIT
name: Upload a release with Release Notes to the project that runs the workflow
on: [push]
jobs:
upload-download:
runs-on: lxc-bookworm
steps:
- uses: actions/checkout@v6
- if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
id: release-notes-file
uses: SELF@vTest
with:
direction: upload
tag: v1.0
token: FORGEJO_TEST_TOKEN
release-dir: upload-dir
release-notes-file: upload-dir/RELEASE_NOTES.md
verbose: true
- uses: actions/checkout@v6
- if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
id: release-notes-file-takes-precedence
uses: SELF@vTest
with:
direction: upload
tag: v2.0
token: FORGEJO_TEST_TOKEN
release-dir: upload-dir
release-notes: "I wont be there"
release-notes-file: upload-dir/RELEASE_NOTES.md
verbose: true
- uses: actions/checkout@v6
- if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
id: release-notes
uses: SELF@vTest
with:
direction: upload
tag: v3.0
token: FORGEJO_TEST_TOKEN
release-dir: upload-dir
release-notes: "I will be there"
verbose: true

View file

@ -0,0 +1 @@
*~

View file

@ -0,0 +1,12 @@
# This is a Release Note
Some *formatted*,
multiline
Markdown content.
```bash
echo "Even a code block"
```

View file

@ -0,0 +1 @@
FILE3

View file

@ -0,0 +1 @@
FILE1

View file

@ -0,0 +1 @@
FILE2

View file

@ -92,5 +92,35 @@ jobs:
- if: ${{ !startsWith(github.ref, 'refs/tags/v') }} - if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
run: | run: |
diff -u upload-dir-v3 download-dir-v3 diff -u upload-dir-v3 download-dir-v3
- if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
id: release-upload-v4
uses: SELF@vTest
with:
direction: upload
tag: v4.0
token: FORGEJO_TEST_TOKEN
skip-assets: true
verbose: true
- if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
id: release-download-v4
uses: SELF@vTest
with:
direction: download
tag: v4.0
token: FORGEJO_TEST_TOKEN
release-dir: download-dir-v4
- if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
run: |
if [ ! -d download-dir-v4 ]; then
echo "Missing download dir"
exit 1
fi
if [ ! -z "$( ls -A download-dir-v4 )" ]; then
echo "Unexpected download files: $( ls -A download-dir-v4 )"
exit 1
fi
- if: failure() - if: failure()
run: docker logs forgejo run: docker logs forgejo