Merge pull request 'run ci build on tag rather than deploy' (#41) from tag-build into main

Reviewed-on: https://codeberg.org/Cyborus/forgejo-cli/pulls/41
This commit is contained in:
Cyborus 2024-04-18 04:38:14 +00:00
commit 24ab090b55

View file

@ -1,5 +1,5 @@
when: when:
- event: deployment - event: tag
steps: steps:
compile-linux: compile-linux:
image: rust:latest image: rust:latest
@ -20,7 +20,9 @@ steps:
commands: commands:
- apt update - apt update
- apt install zip -y - apt install zip -y
- zip forgejo-cli-windows.zip target/x86_64-pc-windows-gnu/release/fj.exe - 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 - gzip -c target/x86_64-unknown-linux-gnu/release/fj > forgejo-cli-linux.gz
deploy-container: deploy-container:
image: gcr.io/kaniko-project/executor:debug image: gcr.io/kaniko-project/executor:debug
@ -37,7 +39,8 @@ steps:
commands: commands:
- export FORGE_HOST=$(echo $CI_FORGE_URL | sed -E 's_^https?://__') - export FORGE_HOST=$(echo $CI_FORGE_URL | sed -E 's_^https?://__')
- fj auth add-key $FORGE_HOST $CI_REPO_OWNER $TOKEN - fj auth add-key $FORGE_HOST $CI_REPO_OWNER $TOKEN
- fj --remote $CI_REPO_URL release create $VERSION --create-tag --branch $BRANCH --attach forgejo-cli-windows.zip --attach forgejo-cli-linux.gz - 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 - fj auth logout $FORGE_HOST
secrets: [ token ] secrets: [ token ]