Compare commits

..

No commits in common. "main" and "v2.6.1" have entirely different histories.
main ... v2.6.1

9 changed files with 45 additions and 51 deletions

View file

@ -6,7 +6,7 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- id: forgejo - id: forgejo
uses: https://code.forgejo.org/actions/setup-forgejo@v3.0.2 uses: https://code.forgejo.org/actions/setup-forgejo@v3.0.1
with: with:
user: testuser user: testuser
password: admin1234 password: admin1234
@ -61,11 +61,5 @@ jobs:
export VERBOSE=true export VERBOSE=true
testdata/forgejo-release-test.sh test_run testuser otherrepo testdata/forgejo-release-test.sh test_run testuser otherrepo
- if: always() - if: failure()
name: '[RUNNER] and [FORGEJO] logs' run: docker logs forgejo
run: |
runner_logs="${{ steps.forgejo.outputs.runner-logs }}"
if test -f "$runner_logs"; then
sed -e 's/^/[RUNNER] /' < $runner_logs
fi
docker logs forgejo | sed -e 's/^/[FORGEJO] /'

View file

@ -42,7 +42,7 @@ jobs:
runs-on: docker runs-on: docker
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: actions/forgejo-release@v2.7.2 - uses: actions/forgejo-release@v2.6.0
with: with:
direction: upload direction: upload
url: https://my-forgejo-instance.net url: https://my-forgejo-instance.net
@ -63,7 +63,7 @@ jobs:
runs-on: docker runs-on: docker
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: actions/forgejo-release@v2.7.2 - uses: actions/forgejo-release@v2.6.0
with: with:
direction: download direction: download
url: https://my-forgejo-instance.net url: https://my-forgejo-instance.net

View file

@ -6,21 +6,21 @@ description: |
inputs: inputs:
url: url:
description: 'URL of the Forgejo instance' description: 'URL of the Forgejo instance'
default: '${{ env.FORGEJO_SERVER_URL }}' default: '${{ env.GITHUB_SERVER_URL }}'
repo: repo:
description: 'owner/project relative to the URL' description: 'owner/project relative to the URL'
default: '${{ forge.repository }}' default: '${{ github.repository }}'
tag: tag:
description: 'Tag of the release' description: 'Tag of the release'
default: '${{ forge.ref_name }}' default: '${{ github.ref_name }}'
title: title:
description: 'Title of the release (defaults to tag)' description: 'Title of the release (defaults to tag)'
sha: sha:
description: 'SHA of the release' description: 'SHA of the release'
default: '${{ forge.sha }}' default: '${{ github.sha }}'
token: token:
description: 'Forgejo application token' description: 'Forgejo application token'
default: '${{ forge.token }}' default: '${{ secrets.GITHUB_TOKEN }}'
release-dir: release-dir:
description: 'Directory in whichs release assets are uploaded or downloaded' description: 'Directory in whichs release assets are uploaded or downloaded'
required: true required: true
@ -57,13 +57,7 @@ inputs:
runs: runs:
using: "composite" using: "composite"
steps: steps:
- if: ${{ inputs.release-notes-assistant }} - run: echo "${{ github.action_path }}" >> $GITHUB_PATH
uses: https://data.forgejo.org/actions/cache@v4
with:
key: rna-${{ inputs.repo }}
path: ${{ forge.action_path }}/rna
- run: echo "${{ forge.action_path }}" >> $FORGEJO_PATH
shell: bash shell: bash
- run: | - run: |
export FORGEJO="${{ inputs.url }}" export FORGEJO="${{ inputs.url }}"
@ -84,11 +78,10 @@ runs:
export PRERELEASE="${{ inputs.prerelease }}" export PRERELEASE="${{ inputs.prerelease }}"
export RELEASE_NOTES_ASSISTANT="${{ inputs.release-notes-assistant }}" export RELEASE_NOTES_ASSISTANT="${{ inputs.release-notes-assistant }}"
export RELEASE_NOTES_ASSISTANT_WORKDIR=${{ forge.action_path }}/rna
export HIDE_ARCHIVE_LINK="${{ inputs.hide-archive-link }}" export HIDE_ARCHIVE_LINK="${{ inputs.hide-archive-link }}"
export TOKEN=${{ inputs.token }} export TOKEN="${{ inputs.token }}"
export RELEASE_DIR="${{ inputs.release-dir }}" export RELEASE_DIR="${{ inputs.release-dir }}"

View file

@ -19,8 +19,6 @@ if ${VERBOSE:-false}; then set -x; fi
: ${RETRY:=1} : ${RETRY:=1}
: ${DELAY:=10} : ${DELAY:=10}
RELEASE_NOTES_ASSISTANT_VERSION=v1.4.0 # 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')
@ -29,7 +27,7 @@ export GNUPGHOME
setup_tea() { setup_tea() {
if which tea 2>/dev/null; then if which tea 2>/dev/null; then
TEA_BIN=$(which tea) TEA_BIN=$(which tea)
elif ! test -f $TEA_BIN; then else ! test -f $TEA_BIN;
ARCH=$(dpkg --print-architecture) ARCH=$(dpkg --print-architecture)
curl -sL https://dl.gitea.io/tea/$TEA_VERSION/tea-$TEA_VERSION-linux-"$ARCH" >$TEA_BIN curl -sL https://dl.gitea.io/tea/$TEA_VERSION/tea-$TEA_VERSION-linux-"$ARCH" >$TEA_BIN
chmod +x $TEA_BIN chmod +x $TEA_BIN
@ -118,10 +116,9 @@ release_draft() {
maybe_use_release_note_assistant() { maybe_use_release_note_assistant() {
if "$RELEASE_NOTES_ASSISTANT"; then if "$RELEASE_NOTES_ASSISTANT"; then
curl --fail -s -S -o rna https://code.forgejo.org/forgejo/release-notes-assistant/releases/download/$RELEASE_NOTES_ASSISTANT_VERSION/release-notes-assistant curl --fail -s -S -o rna https://code.forgejo.org/forgejo/release-notes-assistant/releases/download/v1.2.3/release-notes-assistant
chmod +x ./rna chmod +x ./rna
mkdir -p $RELEASE_NOTES_ASSISTANT_WORKDIR ./rna --storage release --storage-location "$TAG" --forgejo-url "$SCHEME"://placeholder:"$TOKEN"@"$HOST" --repository $REPO --token "$TOKEN" release "$TAG"
./rna --workdir=$RELEASE_NOTES_ASSISTANT_WORKDIR --storage release --storage-location "$TAG" --token "$TOKEN" --forgejo-url "$SCHEME://$HOST" --repository $REPO --token "$TOKEN" release "$TAG"
fi fi
} }

View file

@ -12,7 +12,7 @@ jobs:
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- id: forgejo - id: forgejo
uses: https://code.forgejo.org/actions/setup-forgejo@v3.0.2 uses: https://code.forgejo.org/actions/setup-forgejo@v3.0.1
with: with:
user: testuser user: testuser
password: admin1234 password: admin1234

View file

@ -98,7 +98,7 @@ jobs:
uses: SELF@vTest uses: SELF@vTest
with: with:
direction: upload direction: upload
tag: v1.3 tag: v1.2
token: FORGEJO_TEST_TOKEN token: FORGEJO_TEST_TOKEN
release-dir: upload-dir release-dir: upload-dir
release-notes: "RELEASE NOTES" release-notes: "RELEASE NOTES"
@ -109,7 +109,7 @@ jobs:
uses: SELF@vTest uses: SELF@vTest
with: with:
direction: download direction: download
tag: v1.3 tag: v1.2
token: FORGEJO_TEST_TOKEN token: FORGEJO_TEST_TOKEN
release-dir: download-dir release-dir: download-dir
verbose: true verbose: true

View file

@ -4,7 +4,7 @@ name: Upload (and download) a release to (and from) the project that runs the wo
on: [push] on: [push]
jobs: jobs:
upload-download: upload-download:
runs-on: lxc-bookworm runs-on: self-hosted
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- if: ${{ !startsWith(github.ref, 'refs/tags/v') }} - if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
@ -45,6 +45,28 @@ jobs:
- \backslash escape - \backslash escape
- !exclamation_mark - !exclamation_mark
verbose: true verbose: true
- if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
id: release-upload-slash-in-tag
uses: SELF@vTest
with:
direction: upload
tag: a/v3.0
token: FORGEJO_TOKEN
release-dir: upload-dir
release-notes: "RELEASE NOTES"
verbose: true
- if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
id: release-upload-override-slash-in-tag
uses: SELF@vTest
with:
direction: upload
tag: a/v3.0
token: FORGEJO_TOKEN
release-dir: upload-dir
release-notes-assistant: true
hide-archive-link: true
override: true
verbose: true
- if: ${{ !startsWith(github.ref, 'refs/tags/v') }} - if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
id: release-download id: release-download
uses: SELF@vTest uses: SELF@vTest
@ -69,28 +91,18 @@ jobs:
- if: ${{ !startsWith(github.ref, 'refs/tags/v') }} - if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
run: | run: |
diff -u upload-dir-v2 download-dir-v2 diff -u upload-dir-v2 download-dir-v2
- if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
id: release-upload-slash-in-tag
uses: SELF@vTest
with:
direction: upload
tag: v/3.0
token: FORGEJO_TEST_TOKEN
release-dir: upload-dir-v3
release-notes: "RELEASE NOTES"
verbose: true
- if: ${{ !startsWith(github.ref, 'refs/tags/v') }} - if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
id: release-download-with-slash-in-tag id: release-download-with-slash-in-tag
uses: SELF@vTest uses: SELF@vTest
with: with:
direction: download direction: download
tag: v/3.0 tag: a/v3.0
token: FORGEJO_TEST_TOKEN token: FORGEJO_TEST_TOKEN
release-dir: download-dir-v3 release-dir: download-dir-v3a
download-latest: true
verbose: true verbose: true
- 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 download-dir-v3a
- if: failure() - if: failure()
run: docker logs forgejo run: docker logs forgejo

View file

@ -1 +0,0 @@
FILE1-V3

View file

@ -1 +0,0 @@
FILE2-V3