mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-08 18:04:14 +01:00
[CI] Forgejo Actions based release process (squash) release notes
This commit is contained in:
parent
7afec520c4
commit
d8f4f4807b
3 changed files with 35 additions and 21 deletions
|
@ -16,8 +16,8 @@ inputs:
|
||||||
doer:
|
doer:
|
||||||
description: 'Name of the user authoring the release'
|
description: 'Name of the user authoring the release'
|
||||||
required: true
|
required: true
|
||||||
ref_name:
|
tag-version:
|
||||||
description: 'Git reference of the tag for which the release must be built'
|
description: 'Version of the release derived from the tag withint the leading v'
|
||||||
required: true
|
required: true
|
||||||
suffix:
|
suffix:
|
||||||
description: 'Suffix to add to the image tag'
|
description: 'Suffix to add to the image tag'
|
||||||
|
@ -30,6 +30,9 @@ inputs:
|
||||||
platforms:
|
platforms:
|
||||||
description: 'Coma separated list of platforms'
|
description: 'Coma separated list of platforms'
|
||||||
default: 'linux/amd64,linux/arm64'
|
default: 'linux/amd64,linux/arm64'
|
||||||
|
release-notes:
|
||||||
|
description: 'Full text of the release notes'
|
||||||
|
default: 'Release notes placeholder'
|
||||||
binary-name:
|
binary-name:
|
||||||
description: 'Name of the binary'
|
description: 'Name of the binary'
|
||||||
binary-path:
|
binary-path:
|
||||||
|
@ -103,14 +106,6 @@ runs:
|
||||||
env:
|
env:
|
||||||
CI_REGISTRY: "${{ steps.registry.outputs.host-port }}"
|
CI_REGISTRY: "${{ steps.registry.outputs.host-port }}"
|
||||||
|
|
||||||
- name: Create the tag and image variable
|
|
||||||
id: build
|
|
||||||
run: |
|
|
||||||
${{ steps.verbose.outputs.shell }}
|
|
||||||
tag="${{ inputs.ref_name }}"
|
|
||||||
tag=${tag##*v}
|
|
||||||
echo "tag=$tag" >> "$GITHUB_OUTPUT"
|
|
||||||
|
|
||||||
- name: Build the container image for each architecture
|
- name: Build the container image for each architecture
|
||||||
uses: https://github.com/docker/build-push-action@v4
|
uses: https://github.com/docker/build-push-action@v4
|
||||||
# workaround until https://github.com/docker/build-push-action/commit/d8823bfaed2a82c6f5d4799a2f8e86173c461aba is in @v4 or @v5 is released
|
# workaround until https://github.com/docker/build-push-action/commit/d8823bfaed2a82c6f5d4799a2f8e86173c461aba is in @v4 or @v5 is released
|
||||||
|
@ -121,7 +116,7 @@ runs:
|
||||||
push: true
|
push: true
|
||||||
file: ${{ inputs.dockerfile }}
|
file: ${{ inputs.dockerfile }}
|
||||||
platforms: ${{ inputs.platforms }}
|
platforms: ${{ inputs.platforms }}
|
||||||
tags: ${{ steps.registry.outputs.host-port }}/${{ inputs.owner }}/${{ inputs.repository }}:${{ steps.build.outputs.tag }}${{ inputs.suffix }}
|
tags: ${{ steps.registry.outputs.host-port }}/${{ inputs.owner }}/${{ inputs.repository }}:${{ inputs.tag-version }}${{ inputs.suffix }}
|
||||||
|
|
||||||
- name: Extract the binary from the container images into the release directory
|
- name: Extract the binary from the container images into the release directory
|
||||||
if: inputs.binary-name != ''
|
if: inputs.binary-name != ''
|
||||||
|
@ -131,8 +126,8 @@ runs:
|
||||||
cd release
|
cd release
|
||||||
for platform in $(echo ${{ inputs.platforms }} | tr ',' ' '); do
|
for platform in $(echo ${{ inputs.platforms }} | tr ',' ' '); do
|
||||||
arch=$(echo $platform | sed -e 's|linux/||g' -e 's|arm/v6|arm-6|g')
|
arch=$(echo $platform | sed -e 's|linux/||g' -e 's|arm/v6|arm-6|g')
|
||||||
docker create --platform $platform --name forgejo-$arch ${{ steps.registry.outputs.host-port }}/${{ inputs.owner }}/${{ inputs.repository }}:${{ steps.build.outputs.tag }}${{ inputs.suffix }}
|
docker create --platform $platform --name forgejo-$arch ${{ steps.registry.outputs.host-port }}/${{ inputs.owner }}/${{ inputs.repository }}:${{ inputs.tag-version }}${{ inputs.suffix }}
|
||||||
binary="${{ inputs.binary-name }}-${{ steps.build.outputs.tag }}-linux"
|
binary="${{ inputs.binary-name }}-${{ inputs.tag-version }}-linux"
|
||||||
docker cp forgejo-$arch:${{ inputs.binary-path }} $binary-$arch
|
docker cp forgejo-$arch:${{ inputs.binary-path }} $binary-$arch
|
||||||
xz --keep -9 $binary-$arch
|
xz --keep -9 $binary-$arch
|
||||||
shasum -a 256 $binary-$arch > $binary-$arch.sha256
|
shasum -a 256 $binary-$arch > $binary-$arch.sha256
|
||||||
|
@ -146,6 +141,6 @@ runs:
|
||||||
with:
|
with:
|
||||||
direction: upload
|
direction: upload
|
||||||
release-dir: release
|
release-dir: release
|
||||||
release-notes: "RELEASE-NOTES#${{ steps.build.outputs.tag }}"
|
release-notes: "${{ inputs.release-notes }}"
|
||||||
token: ${{ inputs.token }}
|
token: ${{ inputs.token }}
|
||||||
verbose: ${{ steps.verbose.outputs.value }}
|
verbose: ${{ steps.verbose.outputs.value }}
|
||||||
|
|
|
@ -4,6 +4,8 @@ on:
|
||||||
push:
|
push:
|
||||||
paths:
|
paths:
|
||||||
- Makefile
|
- Makefile
|
||||||
|
- Dockerfile
|
||||||
|
- Dockerfile.rootless
|
||||||
- docker/**
|
- docker/**
|
||||||
- .forgejo/actions/build-release/action.yml
|
- .forgejo/actions/build-release/action.yml
|
||||||
- .forgejo/workflows/build-release.yml
|
- .forgejo/workflows/build-release.yml
|
||||||
|
|
|
@ -48,11 +48,26 @@ jobs:
|
||||||
go-version: ">=1.20"
|
go-version: ">=1.20"
|
||||||
check-latest: true
|
check-latest: true
|
||||||
|
|
||||||
- name: build sources
|
- name: Create the version from ref_name
|
||||||
|
id: tag-version
|
||||||
|
run: |
|
||||||
|
version="${{ github.ref_name }}"
|
||||||
|
version=${version##*v}
|
||||||
|
echo "value=$version" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
- name: Create the release notes
|
||||||
|
id: release-notes
|
||||||
|
run: |
|
||||||
|
cat >> "$GITHUB_OUTPUT" <<EOF
|
||||||
|
value<<ENDVAR
|
||||||
|
See https://codeberg.org/forgejo/forgejo/src/branch/forgejo/RELEASE-NOTES.md#${{ steps.tag-version.outputs.value }}
|
||||||
|
ENDVAR
|
||||||
|
EOF
|
||||||
|
|
||||||
|
- name: Build sources
|
||||||
run: |
|
run: |
|
||||||
apt-get -qq install -y make
|
apt-get -qq install -y make
|
||||||
tag="${{ github.ref_name }}"
|
make VERSION=${{ steps.tag-version.outputs.value }} sources-tarbal
|
||||||
make VERSION=${tag##*v} sources-tarbal
|
|
||||||
mv dist/release release
|
mv dist/release release
|
||||||
find release | grep tar.gz # sanity check to fail fast
|
find release | grep tar.gz # sanity check to fail fast
|
||||||
|
|
||||||
|
@ -64,9 +79,10 @@ jobs:
|
||||||
owner: "${{ env.GITHUB_REPOSITORY_OWNER }}"
|
owner: "${{ env.GITHUB_REPOSITORY_OWNER }}"
|
||||||
repository: "${{ steps.repository.outputs.value }}"
|
repository: "${{ steps.repository.outputs.value }}"
|
||||||
doer: root
|
doer: root
|
||||||
ref_name: "${{ github.ref_name }}"
|
tag-version: "${{ steps.tag-version.outputs.value }}"
|
||||||
token: ${{ steps.token.outputs.value }}
|
token: ${{ steps.token.outputs.value }}
|
||||||
platforms: linux/amd64,linux/arm64,linux/arm/v6
|
platforms: linux/amd64,linux/arm64,linux/arm/v6
|
||||||
|
release-notes: "${{ steps.release-notes.outputs.value }}"
|
||||||
binary-name: forgejo
|
binary-name: forgejo
|
||||||
binary-path: /app/gitea/gitea
|
binary-path: /app/gitea/gitea
|
||||||
verbose: ${{ steps.verbose.outputs.value }}
|
verbose: ${{ steps.verbose.outputs.value }}
|
||||||
|
@ -79,7 +95,7 @@ jobs:
|
||||||
owner: "${{ env.GITHUB_REPOSITORY_OWNER }}"
|
owner: "${{ env.GITHUB_REPOSITORY_OWNER }}"
|
||||||
repository: "${{ steps.repository.outputs.value }}"
|
repository: "${{ steps.repository.outputs.value }}"
|
||||||
doer: root
|
doer: root
|
||||||
ref_name: "${{ github.ref_name }}"
|
tag-version: "${{ steps.tag-version.outputs.value }}"
|
||||||
token: ${{ steps.token.outputs.value }}
|
token: ${{ steps.token.outputs.value }}
|
||||||
platforms: linux/amd64,linux/arm64,linux/arm/v6
|
platforms: linux/amd64,linux/arm64,linux/arm/v6
|
||||||
suffix: -rootless
|
suffix: -rootless
|
||||||
|
@ -94,9 +110,10 @@ jobs:
|
||||||
owner: "${{ env.GITHUB_REPOSITORY_OWNER }}"
|
owner: "${{ env.GITHUB_REPOSITORY_OWNER }}"
|
||||||
repository: "${{ steps.repository.outputs.value }}"
|
repository: "${{ steps.repository.outputs.value }}"
|
||||||
doer: "${{ secrets.DOER }}"
|
doer: "${{ secrets.DOER }}"
|
||||||
ref_name: "${{ github.ref_name }}"
|
tag-version: "${{ steps.tag-version.outputs.value }}"
|
||||||
token: "${{ secrets.TOKEN }}"
|
token: "${{ secrets.TOKEN }}"
|
||||||
platforms: linux/amd64,linux/arm64,linux/arm/v6
|
platforms: linux/amd64,linux/arm64,linux/arm/v6
|
||||||
|
release-notes: "${{ steps.release-notes.outputs.value }}"
|
||||||
binary-name: forgejo
|
binary-name: forgejo
|
||||||
binary-path: /app/gitea/gitea
|
binary-path: /app/gitea/gitea
|
||||||
verbose: ${{ steps.verbose.outputs.value }}
|
verbose: ${{ steps.verbose.outputs.value }}
|
||||||
|
@ -109,7 +126,7 @@ jobs:
|
||||||
owner: "${{ env.GITHUB_REPOSITORY_OWNER }}"
|
owner: "${{ env.GITHUB_REPOSITORY_OWNER }}"
|
||||||
repository: "${{ steps.repository.outputs.value }}"
|
repository: "${{ steps.repository.outputs.value }}"
|
||||||
doer: "${{ secrets.DOER }}"
|
doer: "${{ secrets.DOER }}"
|
||||||
ref_name: "${{ github.ref_name }}"
|
tag-version: "${{ steps.tag-version.outputs.value }}"
|
||||||
token: "${{ secrets.TOKEN }}"
|
token: "${{ secrets.TOKEN }}"
|
||||||
platforms: linux/amd64,linux/arm64,linux/arm/v6
|
platforms: linux/amd64,linux/arm64,linux/arm/v6
|
||||||
suffix: -rootless
|
suffix: -rootless
|
||||||
|
|
Loading…
Reference in a new issue