diff --git a/.forgejo/workflows/integration.yml b/.forgejo/workflows/integration.yml index 50d4a3a..5f23aa3 100644 --- a/.forgejo/workflows/integration.yml +++ b/.forgejo/workflows/integration.yml @@ -6,7 +6,7 @@ jobs: - uses: actions/checkout@v4 - id: forgejo - uses: https://code.forgejo.org/actions/setup-forgejo@v3.0.1 + uses: https://code.forgejo.org/actions/setup-forgejo@v3.0.2 with: user: testuser password: admin1234 @@ -61,5 +61,11 @@ jobs: export VERBOSE=true testdata/forgejo-release-test.sh test_run testuser otherrepo - - if: failure() - run: docker logs forgejo + - if: always() + name: '[RUNNER] and [FORGEJO] logs' + 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] /' diff --git a/README.md b/README.md index 59b077e..9ff302a 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ jobs: runs-on: docker steps: - uses: actions/checkout@v4 - - uses: actions/forgejo-release@v2.6.1 + - uses: actions/forgejo-release@v2.7.2 with: direction: upload url: https://my-forgejo-instance.net @@ -63,7 +63,7 @@ jobs: runs-on: docker steps: - uses: actions/checkout@v4 - - uses: actions/forgejo-release@v2.6.1 + - uses: actions/forgejo-release@v2.7.2 with: direction: download url: https://my-forgejo-instance.net diff --git a/action.yml b/action.yml index 7e09788..f6725c7 100644 --- a/action.yml +++ b/action.yml @@ -6,21 +6,21 @@ description: | inputs: url: description: 'URL of the Forgejo instance' - default: '${{ env.GITHUB_SERVER_URL }}' + default: '${{ env.FORGEJO_SERVER_URL }}' repo: description: 'owner/project relative to the URL' - default: '${{ github.repository }}' + default: '${{ forge.repository }}' tag: description: 'Tag of the release' - default: '${{ github.ref_name }}' + default: '${{ forge.ref_name }}' title: description: 'Title of the release (defaults to tag)' sha: description: 'SHA of the release' - default: '${{ github.sha }}' + default: '${{ forge.sha }}' token: description: 'Forgejo application token' - default: '${{ secrets.GITHUB_TOKEN }}' + default: '${{ forge.token }}' release-dir: description: 'Directory in whichs release assets are uploaded or downloaded' required: true @@ -57,7 +57,13 @@ inputs: runs: using: "composite" steps: - - run: echo "${{ github.action_path }}" >> $GITHUB_PATH + - if: ${{ inputs.release-notes-assistant }} + 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 - run: | export FORGEJO="${{ inputs.url }}" @@ -78,10 +84,11 @@ runs: export PRERELEASE="${{ inputs.prerelease }}" 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 TOKEN="${{ inputs.token }}" + export TOKEN=${{ inputs.token }} export RELEASE_DIR="${{ inputs.release-dir }}" diff --git a/forgejo-release.sh b/forgejo-release.sh index 1216ded..041d1c4 100755 --- a/forgejo-release.sh +++ b/forgejo-release.sh @@ -19,7 +19,7 @@ if ${VERBOSE:-false}; then set -x; fi : ${RETRY:=1} : ${DELAY:=10} -RELEASE_NOTES_ASSISTANT_VERSION=v1.3.3 # renovate: datasource=forgejo-releases depName=forgejo/release-notes-assistant registryUrl=https://code.forgejo.org +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_URL=$(echo "$TAG" | sed 's/\//%2F/g') @@ -29,7 +29,7 @@ export GNUPGHOME setup_tea() { if which tea 2>/dev/null; then TEA_BIN=$(which tea) - else ! test -f $TEA_BIN; + elif ! test -f $TEA_BIN; then ARCH=$(dpkg --print-architecture) curl -sL https://dl.gitea.io/tea/$TEA_VERSION/tea-$TEA_VERSION-linux-"$ARCH" >$TEA_BIN chmod +x $TEA_BIN @@ -120,7 +120,8 @@ maybe_use_release_note_assistant() { 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 chmod +x ./rna - ./rna --storage release --storage-location "$TAG" --forgejo-url "$SCHEME"://placeholder:"$TOKEN"@"$HOST" --repository $REPO --token "$TOKEN" release "$TAG" + mkdir -p $RELEASE_NOTES_ASSISTANT_WORKDIR + ./rna --workdir=$RELEASE_NOTES_ASSISTANT_WORKDIR --storage release --storage-location "$TAG" --token "$TOKEN" --forgejo-url "$SCHEME://$HOST" --repository $REPO --token "$TOKEN" release "$TAG" fi } diff --git a/testdata/nested-upload-download/.forgejo/workflows/test.yml b/testdata/nested-upload-download/.forgejo/workflows/test.yml index ff6806a..c6939b5 100644 --- a/testdata/nested-upload-download/.forgejo/workflows/test.yml +++ b/testdata/nested-upload-download/.forgejo/workflows/test.yml @@ -12,7 +12,7 @@ jobs: steps: - uses: actions/checkout@v4 - id: forgejo - uses: https://code.forgejo.org/actions/setup-forgejo@v3.0.1 + uses: https://code.forgejo.org/actions/setup-forgejo@v3.0.2 with: user: testuser password: admin1234