Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7df71c0278 | |||
| b34fa35ec7 | |||
| 06b262de81 | |||
| 436e40d2ca | |||
| d6f55c70cb | |||
| 31379026f3 | |||
| 184358025f | |||
| 5bd2aaa7a9 | |||
| 12d1a7b737 | |||
| a04f461c12 | |||
| db7460ca33 |
@@ -201,3 +201,4 @@ cython_debug/
|
|||||||
# PyPI configuration file
|
# PyPI configuration file
|
||||||
.pypirc
|
.pypirc
|
||||||
|
|
||||||
|
*.code-workspace
|
||||||
@@ -20,5 +20,6 @@ runs:
|
|||||||
$NAME: ${{ inputs.name }}
|
$NAME: ${{ inputs.name }}
|
||||||
run: |
|
run: |
|
||||||
name="${NAME:-${{ inputs.file }}}"
|
name="${NAME:-${{ inputs.file }}}"
|
||||||
|
name="${name##*/}"
|
||||||
curl --fail-with-body -X POST -H "Authorization: token ${ACTI_BOT_TOKEN}" -F "attachment=@${{ inputs.file }}" \
|
curl --fail-with-body -X POST -H "Authorization: token ${ACTI_BOT_TOKEN}" -F "attachment=@${{ inputs.file }}" \
|
||||||
${{ gitea.api_url }}/repos/${{ gitea.repository }}/releases/${{ inputs.release }}/assets?name=${name}
|
${{ gitea.api_url }}/repos/${{ gitea.repository }}/releases/${{ inputs.release }}/assets?name=${name}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
name: build & push
|
||||||
|
description: build & push OCI container images to the Gitea registry
|
||||||
|
|
||||||
|
inputs:
|
||||||
|
name:
|
||||||
|
description: image name
|
||||||
|
required: true
|
||||||
|
tags:
|
||||||
|
description: newline-separated list of tags to tag the image
|
||||||
|
required: true
|
||||||
|
containerfile:
|
||||||
|
description: target container file to build
|
||||||
|
required: false
|
||||||
|
default: Containerfile
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: composite
|
||||||
|
steps:
|
||||||
|
- shell: bash
|
||||||
|
run: |
|
||||||
|
repo_url="${{ gitea.event.repository.html_url }}"
|
||||||
|
repo_host="${repo_url#https://}"
|
||||||
|
repo_host="${repo_host%%/*}"
|
||||||
|
docker login --username acti-bot --password ${ACTI_BOT_TOKEN} ${repo_host}
|
||||||
|
|
||||||
|
docker build -f ${{ inputs.containerfile }} -t img-${{ gitea.run_id }} .
|
||||||
|
while IFS= read -r tag; do
|
||||||
|
[[ -z "$tag" ]] && continue
|
||||||
|
|
||||||
|
image="${repo_host}/${{ gitea.repository }}/${{ inputs.name }}:$tag"
|
||||||
|
docker tag img-${{ gitea.run_id }} $image
|
||||||
|
docker push $image
|
||||||
|
done <<< "${{ inputs.tags }}"
|
||||||
+4
-1
@@ -20,8 +20,11 @@ runs:
|
|||||||
using: composite
|
using: composite
|
||||||
steps:
|
steps:
|
||||||
- shell: bash
|
- shell: bash
|
||||||
|
env:
|
||||||
|
INPUT_FILE: ${{ inputs.file }}
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
filename="${INPUT_FILE##*/}"
|
||||||
if [[ "${{ inputs.force }}" == "true" ]]; then
|
if [[ "${{ inputs.force }}" == "true" ]]; then
|
||||||
status="$(
|
status="$(
|
||||||
curl --silent --show-error --output /dev/null --write-out '%{http_code}' \
|
curl --silent --show-error --output /dev/null --write-out '%{http_code}' \
|
||||||
@@ -41,4 +44,4 @@ runs:
|
|||||||
curl --fail-with-body \
|
curl --fail-with-body \
|
||||||
--user "acti-bot:${ACTI_BOT_TOKEN}" \
|
--user "acti-bot:${ACTI_BOT_TOKEN}" \
|
||||||
--upload-file ${{ inputs.file }} \
|
--upload-file ${{ inputs.file }} \
|
||||||
"${{ gitea.server_url }}/api/packages/${{ gitea.repository_owner }}/generic/${{ inputs.package }}/${{ inputs.version }}/${{ inputs.file }}"
|
"${{ gitea.server_url }}/api/packages/${{ gitea.repository_owner }}/generic/${{ inputs.package }}/${{ inputs.version }}/${filename}"
|
||||||
|
|||||||
Reference in New Issue
Block a user