runner/.forgejo/workflows/build-release.yml

94 lines
3.1 KiB
YAML
Raw Normal View History

# SPDX-License-Identifier: MIT
#
# https://code.forgejo.org/forgejo/runner
#
# Build the runner binaries and OCI images
#
# ROLE: forgejo-integration
# DOER: forgejo-ci
# TOKEN: <generated from https://code.forgejo.org/forgejo-ci>
#
2023-04-30 18:26:17 +02:00
name: Build release
on:
2023-04-30 18:26:17 +02:00
push:
tags:
- 'v*'
2023-04-30 18:26:17 +02:00
enable-email-notifications: true
2023-04-30 18:26:17 +02:00
jobs:
release:
2024-12-09 14:31:33 +00:00
runs-on: lxc-bookworm
2023-04-30 18:26:17 +02:00
# root is used for testing, allow it
if: vars.ROLE == 'forgejo-integration' || forge.repository_owner == 'root'
2023-04-30 18:26:17 +02:00
steps:
- uses: https://data.forgejo.org/actions/checkout@v4
2023-04-30 18:26:17 +02:00
- name: Increase the verbosity when there are no secrets
id: verbose
2023-04-30 18:26:17 +02:00
run: |
if test -z "${{ secrets.TOKEN }}"; then
value=true
else
value=false
fi
echo "value=$value" >> "$FORGEJO_OUTPUT"
- name: Sanitize the name of the repository
id: repository
run: |
echo "value=${FORGEJO_REPOSITORY##*/}" >> "$FORGEJO_OUTPUT"
- name: create test TOKEN
id: token
if: ${{ secrets.TOKEN == '' }}
2023-04-30 18:26:17 +02:00
run: |
apt-get -qq install -y jq
url="${{ env.FORGEJO_SERVER_URL }}"
2023-04-30 18:26:17 +02:00
hostport=${url##http*://}
hostport=${hostport%%/}
doer=root
api=http://$doer:admin1234@$hostport/api/v1/users/$doer/tokens
curl -sS -X DELETE $api/release
token=$(curl -sS -X POST -H 'Content-Type: application/json' --data-raw '{"name": "release", "scopes": ["all"]}' $api | jq --raw-output .sha1)
echo "value=${token}" >> "$FORGEJO_OUTPUT"
2023-04-30 18:26:17 +02:00
- name: version from ref_name
id: tag-version
2023-04-30 18:26:17 +02:00
run: |
version=${FORGEJO_REF_NAME##*v}
echo "value=$version" >> "$FORGEJO_OUTPUT"
2023-04-30 18:26:17 +02:00
- name: build without TOKEN
2023-04-30 18:26:17 +02:00
if: ${{ secrets.TOKEN == '' }}
Update https://data.forgejo.org/forgejo/forgejo-build-publish action to v5.4.1 (#788) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [https://data.forgejo.org/forgejo/forgejo-build-publish](https://data.forgejo.org/forgejo/forgejo-build-publish) | action | patch | `v5.4.0` -> `v5.4.1` | --- ### Release Notes <details> <summary>forgejo/forgejo-build-publish (https://data.forgejo.org/forgejo/forgejo-build-publish)</summary> ### [`v5.4.1`](https://data.forgejo.org/forgejo/forgejo-build-publish/compare/v5.4.0...v5.4.1) [Compare Source](https://data.forgejo.org/forgejo/forgejo-build-publish/compare/v5.4.0...v5.4.1) </details> --- ### Configuration 📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC), Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS40My41IiwidXBkYXRlZEluVmVyIjoiNDEuNDMuNSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==--> Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/788 Co-authored-by: Renovate Bot <bot@kriese.eu> Co-committed-by: Renovate Bot <bot@kriese.eu>
2025-08-02 00:33:14 +00:00
uses: https://data.forgejo.org/forgejo/forgejo-build-publish/build@v5.4.1
2023-04-30 18:26:17 +02:00
with:
forgejo: "${{ env.FORGEJO_SERVER_URL }}"
owner: "${{ env.FORGEJO_REPOSITORY_OWNER }}"
repository: "${{ steps.repository.outputs.value }}"
doer: root
sha: "${{ forge.sha }}"
2024-05-19 12:35:31 +02:00
release-version: "${{ steps.tag-version.outputs.value }}"
token: ${{ steps.token.outputs.value }}
platforms: linux/amd64,linux/arm64
binary-name: forgejo-runner
binary-path: /bin/forgejo-runner
2023-04-30 18:26:17 +02:00
verbose: ${{ steps.verbose.outputs.value }}
- name: build with TOKEN
2023-04-30 18:26:17 +02:00
if: ${{ secrets.TOKEN != '' }}
Update https://data.forgejo.org/forgejo/forgejo-build-publish action to v5.4.1 (#788) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [https://data.forgejo.org/forgejo/forgejo-build-publish](https://data.forgejo.org/forgejo/forgejo-build-publish) | action | patch | `v5.4.0` -> `v5.4.1` | --- ### Release Notes <details> <summary>forgejo/forgejo-build-publish (https://data.forgejo.org/forgejo/forgejo-build-publish)</summary> ### [`v5.4.1`](https://data.forgejo.org/forgejo/forgejo-build-publish/compare/v5.4.0...v5.4.1) [Compare Source](https://data.forgejo.org/forgejo/forgejo-build-publish/compare/v5.4.0...v5.4.1) </details> --- ### Configuration 📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC), Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS40My41IiwidXBkYXRlZEluVmVyIjoiNDEuNDMuNSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==--> Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/788 Co-authored-by: Renovate Bot <bot@kriese.eu> Co-committed-by: Renovate Bot <bot@kriese.eu>
2025-08-02 00:33:14 +00:00
uses: https://data.forgejo.org/forgejo/forgejo-build-publish/build@v5.4.1
2023-04-30 18:26:17 +02:00
with:
forgejo: "${{ env.FORGEJO_SERVER_URL }}"
owner: "${{ env.FORGEJO_REPOSITORY_OWNER }}"
repository: "${{ steps.repository.outputs.value }}"
doer: "${{ secrets.DOER }}"
sha: "${{ forge.sha }}"
2024-05-19 12:35:31 +02:00
release-version: "${{ steps.tag-version.outputs.value }}"
token: "${{ secrets.TOKEN }}"
platforms: linux/amd64,linux/arm64
binary-name: forgejo-runner
binary-path: /bin/forgejo-runner
2023-04-30 18:26:17 +02:00
verbose: ${{ steps.verbose.outputs.value }}