forgejo-cli/.woodpecker/deploy.yml

41 lines
1.5 KiB
YAML
Raw Normal View History

2023-12-17 05:45:28 +01:00
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
2023-12-17 08:01:00 +01:00
- apt update
2023-12-17 07:56:18 +01:00
- apt install gcc-mingw-w64-x86-64 -y
2023-12-17 05:45:28 +01:00
- 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"
2023-12-17 05:45:28 +01:00
secrets: [ token ]
release:
image: codeberg.org/cyborus/forgejo-cli:latest
pull: true
commands:
- echo $TOKEN | fj auth add-key codeberg.org Cyborus
2023-12-17 17:24:06 +01:00
- fj -R $CI_REPO_URL release create $VERSION --create-tag --branch $BRANCH --attach forgejo-cli-windows.zip --attach forgejo-cli-windows.gz
2023-12-17 05:45:28 +01:00
- fj auth logout codeberg.org
secrets: [ token ]