mirror of
https://code.forgejo.org/actions/forgejo-release
synced 2025-09-04 05:52:46 +02:00
Compare commits
18 commits
Author | SHA1 | Date | |
---|---|---|---|
|
9223b9c0d5 | ||
|
9f05f9811a | ||
|
25f6ec3fc2 | ||
|
c263d31a62 | ||
|
7b6b1cd6b6 | ||
|
5d24b53805 | ||
|
ac7e1b6ea3 | ||
|
777842e57f | ||
|
1c7fea91f7 | ||
|
c15813dcfb | ||
|
26fe28ef1e | ||
|
76ca8d5b17 | ||
|
d21db0da1a | ||
|
63485695ff | ||
|
466ca34619 | ||
|
b669ffeda7 | ||
|
322d5ebe18 | ||
|
d051ae27b2 |
9 changed files with 51 additions and 45 deletions
|
@ -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.1
|
uses: https://code.forgejo.org/actions/setup-forgejo@v3.0.2
|
||||||
with:
|
with:
|
||||||
user: testuser
|
user: testuser
|
||||||
password: admin1234
|
password: admin1234
|
||||||
|
@ -61,5 +61,11 @@ 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: failure()
|
- if: always()
|
||||||
run: docker logs forgejo
|
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] /'
|
||||||
|
|
|
@ -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.6.0
|
- uses: actions/forgejo-release@v2.7.2
|
||||||
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.6.0
|
- uses: actions/forgejo-release@v2.7.2
|
||||||
with:
|
with:
|
||||||
direction: download
|
direction: download
|
||||||
url: https://my-forgejo-instance.net
|
url: https://my-forgejo-instance.net
|
||||||
|
|
21
action.yml
21
action.yml
|
@ -6,21 +6,21 @@ description: |
|
||||||
inputs:
|
inputs:
|
||||||
url:
|
url:
|
||||||
description: 'URL of the Forgejo instance'
|
description: 'URL of the Forgejo instance'
|
||||||
default: '${{ env.GITHUB_SERVER_URL }}'
|
default: '${{ env.FORGEJO_SERVER_URL }}'
|
||||||
repo:
|
repo:
|
||||||
description: 'owner/project relative to the URL'
|
description: 'owner/project relative to the URL'
|
||||||
default: '${{ github.repository }}'
|
default: '${{ forge.repository }}'
|
||||||
tag:
|
tag:
|
||||||
description: 'Tag of the release'
|
description: 'Tag of the release'
|
||||||
default: '${{ github.ref_name }}'
|
default: '${{ forge.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: '${{ github.sha }}'
|
default: '${{ forge.sha }}'
|
||||||
token:
|
token:
|
||||||
description: 'Forgejo application token'
|
description: 'Forgejo application token'
|
||||||
default: '${{ secrets.GITHUB_TOKEN }}'
|
default: '${{ forge.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,7 +57,13 @@ inputs:
|
||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
steps:
|
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
|
shell: bash
|
||||||
- run: |
|
- run: |
|
||||||
export FORGEJO="${{ inputs.url }}"
|
export FORGEJO="${{ inputs.url }}"
|
||||||
|
@ -78,10 +84,11 @@ 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 }}"
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,8 @@ 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')
|
||||||
|
|
||||||
|
@ -27,7 +29,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)
|
||||||
else ! test -f $TEA_BIN;
|
elif ! test -f $TEA_BIN; then
|
||||||
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
|
||||||
|
@ -116,9 +118,10 @@ 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/v1.2.3/release-notes-assistant
|
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
|
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
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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.1
|
uses: https://code.forgejo.org/actions/setup-forgejo@v3.0.2
|
||||||
with:
|
with:
|
||||||
user: testuser
|
user: testuser
|
||||||
password: admin1234
|
password: admin1234
|
||||||
|
|
|
@ -98,7 +98,7 @@ jobs:
|
||||||
uses: SELF@vTest
|
uses: SELF@vTest
|
||||||
with:
|
with:
|
||||||
direction: upload
|
direction: upload
|
||||||
tag: v1.2
|
tag: v1.3
|
||||||
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.2
|
tag: v1.3
|
||||||
token: FORGEJO_TEST_TOKEN
|
token: FORGEJO_TEST_TOKEN
|
||||||
release-dir: download-dir
|
release-dir: download-dir
|
||||||
verbose: true
|
verbose: true
|
||||||
|
|
|
@ -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: self-hosted
|
runs-on: lxc-bookworm
|
||||||
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,28 +45,6 @@ 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
|
||||||
|
@ -91,18 +69,28 @@ 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: a/v3.0
|
tag: v/3.0
|
||||||
token: FORGEJO_TEST_TOKEN
|
token: FORGEJO_TEST_TOKEN
|
||||||
release-dir: download-dir-v3a
|
release-dir: download-dir-v3
|
||||||
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 download-dir-v3a
|
diff -u upload-dir-v3 download-dir-v3
|
||||||
- if: failure()
|
- if: failure()
|
||||||
run: docker logs forgejo
|
run: docker logs forgejo
|
||||||
|
|
1
testdata/upload-download/upload-dir-v3/file1-v3.txt
vendored
Normal file
1
testdata/upload-download/upload-dir-v3/file1-v3.txt
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
FILE1-V3
|
1
testdata/upload-download/upload-dir-v3/file2-v3.txt
vendored
Normal file
1
testdata/upload-download/upload-dir-v3/file2-v3.txt
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
FILE2-V3
|
Loading…
Add table
Reference in a new issue