summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCyborus <cyborus@noreply.codeberg.org>2023-12-17 06:00:19 +0100
committerCyborus <cyborus@noreply.codeberg.org>2023-12-17 06:00:19 +0100
commit2a167c350ab4612659b4399ff81ce0c772ef37f8 (patch)
tree89695640da9baeec91cd7647a8632e11e374d33e
parentMerge pull request 'add dockerfile' (#16) from dockerfile into main (diff)
parentremove versioned container push for now (diff)
downloadforgejo-cli-2a167c350ab4612659b4399ff81ce0c772ef37f8.tar.xz
forgejo-cli-2a167c350ab4612659b4399ff81ce0c772ef37f8.zip
Merge pull request 'add deployment ci pipeline' (#17) from deploy-ci into main
Reviewed-on: https://codeberg.org/Cyborus/forgejo-cli/pulls/17
-rw-r--r--.woodpecker/deploy.yml38
1 files changed, 38 insertions, 0 deletions
diff --git a/.woodpecker/deploy.yml b/.woodpecker/deploy.yml
new file mode 100644
index 0000000..136dad2
--- /dev/null
+++ b/.woodpecker/deploy.yml
@@ -0,0 +1,38 @@
+when:
+ - event: deployment
+steps:
+ compile-linux:
+ image: rust:latest
+ commands:
+ - rustup target add x86_64-unknown-linux-gnu
+ - cargo build --target=x86_64-unknown-linux-gnu --release
+ - strip target/x86_64-unknown-linux-gnu/release/fj
+ compile-windows:
+ image: rust:latest
+ commands:
+ - rustup target add x86_64-pc-windows-gnu
+ - cargo build --target=x86_64-pc-windows-gnu --release
+ - strip target/x86_64-pc-windows-gnu/release/fj.exe
+ zip:
+ image: debian:12
+ commands:
+ - apt update
+ - apt install zip -y
+ - zip forgejo-cli-windows.zip target/x86_64-pc-windows-gnu/release/fj.exe
+ - 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 AUTH="$(echo -n Cyborus:$TOKEN | base64)"
+ - echo "{\"auths\":{\"codeberg.org\":{\"auth\":\"$AUTH\"}}}" > "/kaniko/.docker/config.json"
+ - executor --context ./ --dockerfile ./Dockerfile --destination "codeberg.org/cyborus/forgejo-cli:latest"
+ secrets: [ token ]
+ release:
+ image: codeberg.org/cyborus/forgejo-cli:latest
+ pull: true
+ commands:
+ - echo $TOKEN | fj auth add-key codeberg.org Cyborus
+ - fj release create $VERSION --create-tag --branch $BRANCH --attach forgejo-cli-windows.zip --attach forgejo-cli-windows.gz
+ - fj auth logout codeberg.org
+ secrets: [ token ]
+