run ci build on tag rather than deploy

This commit is contained in:
Cyborus 2024-04-17 22:49:52 -04:00
parent 7fca58fde6
commit 88b801a7e6
No known key found for this signature in database

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 ]