diff options
author | Daniel Baumann <daniel@debian.org> | 2024-11-04 11:30:10 +0100 |
---|---|---|
committer | Daniel Baumann <daniel@debian.org> | 2024-11-20 07:38:21 +0100 |
commit | 34f503aa3bfba930fd7978a0071786884d73749f (patch) | |
tree | 7e3c8e2506fdd93e29958d9f8cb36fbed4a5af7d /.woodpecker | |
parent | Initial commit. (diff) | |
download | forgejo-cli-34f503aa3bfba930fd7978a0071786884d73749f.tar.xz forgejo-cli-34f503aa3bfba930fd7978a0071786884d73749f.zip |
Adding upstream version 0.1.1.upstream/0.1.1upstream
Signed-off-by: Daniel Baumann <daniel@debian.org>
Diffstat (limited to '.woodpecker')
-rw-r--r-- | .woodpecker/check.yml | 13 | ||||
-rw-r--r-- | .woodpecker/deploy.yml | 48 |
2 files changed, 61 insertions, 0 deletions
diff --git a/.woodpecker/check.yml b/.woodpecker/check.yml new file mode 100644 index 0000000..20508ea --- /dev/null +++ b/.woodpecker/check.yml @@ -0,0 +1,13 @@ +when: + - event: manual + - event: pull_request +steps: + check: + image: rust + commands: + - cargo check + check-fmt: + image: rust + commands: + - rustup component add rustfmt + - cargo fmt --check diff --git a/.woodpecker/deploy.yml b/.woodpecker/deploy.yml new file mode 100644 index 0000000..18f88e4 --- /dev/null +++ b/.woodpecker/deploy.yml @@ -0,0 +1,48 @@ +when: + - event: tag +steps: + compile-linux: + image: rust:latest + commands: + - rustup target add x86_64-unknown-linux-gnu + - cargo build --target=x86_64-unknown-linux-gnu --release --features update-check + - strip target/x86_64-unknown-linux-gnu/release/fj + secrets: [ client_info_codeberg ] + compile-windows: + image: rust:latest + commands: + - rustup target add x86_64-pc-windows-gnu + - apt update + - apt install gcc-mingw-w64-x86-64 -y + - cargo build --target=x86_64-pc-windows-gnu --release --features update-check + - strip target/x86_64-pc-windows-gnu/release/fj.exe + secrets: [ client_info_codeberg ] + zip: + image: debian:12 + commands: + - apt update + - apt install zip -y + - cd target/x86_64-pc-windows-gnu/release + - zip ../../../forgejo-cli-windows.zip fj.exe + - cd ../../.. + - gzip -c target/x86_64-unknown-linux-gnu/release/fj > forgejo-cli-linux.gz + deploy-container: + image: gcr.io/kaniko-project/executor:debug + commands: + - export FORGE_HOST=$(echo $CI_FORGE_URL | sed -E 's_^https?://__') + - export AUTH="$(echo -n $CI_REPO_OWNER:$TOKEN | base64)" + - echo "{\"auths\":{\"$FORGE_HOST\":{\"auth\":\"$AUTH\"}}}" > "/kaniko/.docker/config.json" + - export CONTAINER_OWNER=$(echo $CI_REPO_OWNER | awk '{print tolower($0)}') + - executor --context ./ --dockerfile ./Dockerfile --destination "$FORGE_HOST/$CONTAINER_OWNER/forgejo-cli:latest" + secrets: [ token ] + release: + image: codeberg.org/cyborus/forgejo-cli:latest + pull: true + commands: + - export FORGE_HOST=$(echo $CI_FORGE_URL | sed -E 's_^https?://__') + - fj auth add-key $FORGE_HOST $CI_REPO_OWNER $TOKEN + - fj release --repo $CI_REPO_URL asset create $CI_COMMIT_TAG forgejo-cli-windows.zip + - fj release --repo $CI_REPO_URL asset create $CI_COMMIT_TAG forgejo-cli-linux.gz + - fj auth logout $FORGE_HOST + secrets: [ token ] + |