mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-07-19 17:49:39 +02:00
chore(ci): cache release-notes-assistant working directory [skip ci] (#8556)
to reduce the number of requests to the API to obtain each pull request to the minimum. - cache the working directory - upgrade to [v1.3.0](https://code.forgejo.org/forgejo/release-notes-assistant/releases/tag/v1.3.0) to get optimizations - use the oci:1 image to reduce the network load re-installing every time ## Testing - Pushed to https://codeberg.org/forgejo/forgejo/src/branch/wip-rna so that it gets access to the secrets - Manually triggered [to populate the cache](https://codeberg.org/forgejo/forgejo/actions/runs/89735) cutting the run time from ~2h to ~45min - Manually triggered [to verify the cache is reused](https://codeberg.org/forgejo/forgejo/actions/runs/89759) cutting the run time from ~45min to ~15min  Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8556 Reviewed-by: Gusted <gusted@noreply.codeberg.org> Co-authored-by: Earl Warren <contact@earl-warren.org> Co-committed-by: Earl Warren <contact@earl-warren.org>
This commit is contained in:
parent
88c3b6dead
commit
eaea89b7f0
1 changed files with 13 additions and 11 deletions
|
@ -5,32 +5,34 @@ on:
|
||||||
- cron: '@daily'
|
- cron: '@daily'
|
||||||
|
|
||||||
env:
|
env:
|
||||||
RNA_VERSION: v1.2.5 # renovate: datasource=gitea-releases depName=forgejo/release-notes-assistant registryUrl=https://code.forgejo.org
|
RNA_WORKDIR: /srv/rna
|
||||||
|
RNA_VERSION: v1.3.0 # renovate: datasource=gitea-releases depName=forgejo/release-notes-assistant registryUrl=https://code.forgejo.org
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release-notes:
|
release-notes:
|
||||||
if: vars.ROLE == 'forgejo-coding'
|
if: vars.ROLE == 'forgejo-coding'
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
container:
|
container:
|
||||||
image: 'data.forgejo.org/oci/node:22-bookworm'
|
image: 'data.forgejo.org/oci/ci:1'
|
||||||
steps:
|
steps:
|
||||||
- uses: https://data.forgejo.org/actions/checkout@v4
|
- uses: https://data.forgejo.org/actions/checkout@v4
|
||||||
|
|
||||||
- uses: https://data.forgejo.org/actions/setup-go@v5
|
- uses: https://data.forgejo.org/actions/cache@v4
|
||||||
with:
|
with:
|
||||||
go-version-file: "go.mod"
|
key: rna-${{ env.RNA_VERSION }}
|
||||||
cache: false
|
path: ${{ env.RNA_WORKDIR }}
|
||||||
|
|
||||||
- name: apt install jq
|
- name: install release-notes-assistant
|
||||||
run: |
|
run: |
|
||||||
export DEBIAN_FRONTEND=noninteractive
|
set -x
|
||||||
apt-get update -qq
|
wget -O /usr/local/bin/rna https://code.forgejo.org/forgejo/release-notes-assistant/releases/download/${{ env.RNA_VERSION}}/release-notes-assistant
|
||||||
apt-get -q install -y -qq jq
|
chmod +x /usr/local/bin/rna
|
||||||
|
|
||||||
- name: update open milestones
|
- name: update open milestones
|
||||||
run: |
|
run: |
|
||||||
set -x
|
set -x
|
||||||
curl -sS $GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/milestones?state=open | jq -r '.[] | .title' | while read forgejo version ; do
|
mkdir -p ${{ env.RNA_WORKDIR }}
|
||||||
|
curl -sS $FORGEJO_SERVER_URL/api/v1/repos/$FORGEJO_REPOSITORY/milestones?state=open | jq -r '.[] | .title' | while read forgejo version ; do
|
||||||
milestone="$forgejo $version"
|
milestone="$forgejo $version"
|
||||||
go run code.forgejo.org/forgejo/release-notes-assistant@$RNA_VERSION --config .release-notes-assistant.yaml --storage milestone --storage-location "$milestone" --forgejo-url $GITHUB_SERVER_URL --repository $GITHUB_REPOSITORY --token ${{ secrets.RELEASE_NOTES_ASSISTANT_TOKEN }} release $version
|
rna --workdir ${{ env.RNA_WORKDIR }} --config .release-notes-assistant.yaml --storage milestone --storage-location "$milestone" --forgejo-url $FORGEJO_SERVER_URL --repository $FORGEJO_REPOSITORY --token ${{ secrets.RELEASE_NOTES_ASSISTANT_TOKEN }} release $version
|
||||||
done
|
done
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue