From e5eb2a23df7fc53c699beec032ed6c4223e41fc3 Mon Sep 17 00:00:00 2001 From: dzu Date: Fri, 13 Feb 2026 12:10:31 +0000 Subject: [PATCH 1/4] remove the fallback git token input --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 1b631be..826b1c4 100644 --- a/README.md +++ b/README.md @@ -2,16 +2,15 @@ |name|default|note| |:---:|:---:|:---:| -|token-git|-|master token used for git operations. not required. will be used as a fallback if any of the other two tokens is left unspecified| |build-image|git.dzuchun.ing/actions/anode-builder:latest|image the build process will undergo on. you may want to override it with your own image, if you use static libraries not installed on the default image| |src-repository|-|git repository to clone action's Rust source from| |src-ref|master|ref of the source repository to use| |src-actor|actions|actor for cloning the action source| -|src-token|(token input)|a git token to used to perform a git clone of the action source. not required; action may fail of the git server refuses the operation| +|src-token|-|a git token to used to perform a git clone of the action source. not required; action may fail of the git server refuses the operation| |dst-repository|-|git repository to push the compiled action to| |dst-ref|master|ref of the repository to push the compiled action to.| |dst-actor|actions|actor pushing the compiled action| -|dst-token|(token input)|a git token to used to perform the git push of the compiled action to the destination repository. not required. git server is very likely to refuse the push if you leave this blank| +|dst-token|-|a git token to used to perform the git push of the compiled action to the destination repository. not required. git server is very likely to refuse the push if you leave this blank| |opt-release|false|use release profile| |opt-build-std|false|use nightly toolchain with build-std feature| |opt-upx|false|use UPX to compress the binary even further. please note that this subjects you to UPX's terms of use.| From d69ea2e13911df834263f1f817b0e3408323ef3a Mon Sep 17 00:00:00 2001 From: dzu Date: Fri, 13 Feb 2026 13:46:24 +0000 Subject: [PATCH 2/4] ch: default git refs to "default for the repo" --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 826b1c4..facf1e8 100644 --- a/README.md +++ b/README.md @@ -4,11 +4,11 @@ |:---:|:---:|:---:| |build-image|git.dzuchun.ing/actions/anode-builder:latest|image the build process will undergo on. you may want to override it with your own image, if you use static libraries not installed on the default image| |src-repository|-|git repository to clone action's Rust source from| -|src-ref|master|ref of the source repository to use| +|src-ref|(whatever the default branch is)|ref of the source repository to use| |src-actor|actions|actor for cloning the action source| |src-token|-|a git token to used to perform a git clone of the action source. not required; action may fail of the git server refuses the operation| |dst-repository|-|git repository to push the compiled action to| -|dst-ref|master|ref of the repository to push the compiled action to.| +|dst-ref|(whatever the default branch is)|ref of the repository to push the compiled action to.| |dst-actor|actions|actor pushing the compiled action| |dst-token|-|a git token to used to perform the git push of the compiled action to the destination repository. not required. git server is very likely to refuse the push if you leave this blank| |opt-release|false|use release profile| From e307bca9815a45eeb6ba98889746e3ebf8f03e50 Mon Sep 17 00:00:00 2001 From: dzu Date: Fri, 13 Feb 2026 13:47:26 +0000 Subject: [PATCH 3/4] add action definition as yml --- action.yml | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 action.yml diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..e73b4f8 --- /dev/null +++ b/action.yml @@ -0,0 +1,45 @@ +name: 'Build anode action' +description: 'Checkout, build and update the anode action' +inputs: + build-image: + description: 'OCI image to use for building the action' + default: git.dzuchun.ing/actions/anode-builder:master + required: false + src-repository: + description: 'Git repository to clone the the action source from' + required: true + src-ref: + description: 'Git tag to clone the action source from' + required: false + src-actor: + description: 'Git use to clone the action source as' + default: actions + src-token: + description: 'Git token to use for cloning the action source' + required: false + dst-repository: + description: 'Git repository to upload the compiled actio to' + required: true + dst-ref: + description: 'Git branch to upload the compiled action to' + required: false + dst-actor: + description: 'Git user to upload the action as' + default: actions + dst-token: + description: 'Git token to use whiee uploading the action' + required: false + opt-release: + description: 'Use Rust release profile while compiling the action' + default: false + opt-build-std: + description: 'Use nightly Rust toolchain, and `build-std` feature' + default: false + opt-upx: + description: 'Compress the resulting biinary this UPX' + default: false +runs: + using: composite + steps: + - run: ${{ forgejo.action_path }}/main.sh + shell: bash From 0778593715c45887e20089c474230f9fa2a3aa65 Mon Sep 17 00:00:00 2001 From: dzu Date: Fri, 13 Feb 2026 13:47:41 +0000 Subject: [PATCH 4/4] add main action script --- main.sh | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100755 main.sh diff --git a/main.sh b/main.sh new file mode 100755 index 0000000..b8db8ef --- /dev/null +++ b/main.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +set -eu + +BUILDER_IMAGE=$(printenv INPUT-BUILD-IMAGE) + +SRC_REPOSITORY=$(printenv INPUT-SRC-REPOSITORY) +SRC_REF=$(printenv INPUT-SRC-REF:-master) +SRC_ACTOR=$(printenv INPUT-SRC-REF:-actions) +SRC_TOKEN=$(printenv INPUT-SRC-TOKEN) + +DST_REPOSITORY=$(printenv INPUT-DST-REPOSITORY) +DST_REF=$(printenv INPUT-DST-REF:-master) +DST_ACTOR=$(printenv INPUT-DST-REF:-actions) +DST_TOKEN=$(printenv INPUT-DST-TOKEN) + +OPT_RELEASE=$(printenv INPUT-OPT-RELEASE:-false) +OPT_BUILD_STD=$(printenv INPUT-OPT-BUILD-STD:-false) +OPT_UPX=$(printenv INPUT-OPT-UPX:-false) + +GIT_FPUSH=$(printenv INPUT-GIT-FPUSH:-false) + +echo "SRC_REPOSITORY=$SRC_REPOSITORY" > .env +echo "SRC_REF=$SRC_REF" >> .env +echo "SRC_ACTOR=$SRC_ACTOR" >> .env +echo "SRC_TOKEN=$SRC_TOKEN" >> .env + +echo "DST_REPOSITORY=$DST_REPOSITORY" >> .env +echo "DST_REF=$DST_REF" >> .env +echo "DST_ACTOR=$DST_ACTOR" >> .env +echo "DST_TOKEN=$DST_TOKEN" >> .env + +echo "OPT_RELEASE=$OPT_RELEASE" >> .env +echo "OPT_BUILD_STD=$OPT_BUILD_STD" >> .env +echo "OPT_UPX=$OPT_UPX" >> .env + +echo "GIT_FPUSH=$GIT_FPUSH" >> .env + +docker container run --attach --env-file .env --rm -t $BUILDER_IMAGE /bin/sh /build.sh +rm .env