Dorian Zedler
95638aaa70
Some checks reported errors
continuous-integration/drone/push Build was killed
156 lines
No EOL
3.9 KiB
YAML
156 lines
No EOL
3.9 KiB
YAML
---
|
|
kind: pipeline
|
|
type: docker
|
|
name: start-github-action
|
|
steps:
|
|
- name: create workflow_dispatch event
|
|
image: itsblue.dev/plugins/github-workflow-controller
|
|
settings:
|
|
github_token:
|
|
from_secret: github-token
|
|
github_repo: "dorianim/drone-runner"
|
|
workflow_id: "drone.yml"
|
|
workflow_actions: start
|
|
---
|
|
kind: pipeline
|
|
type: exec
|
|
name: build-receiver-macos
|
|
platform:
|
|
os: darwin
|
|
arch: amd64
|
|
steps:
|
|
- name: build
|
|
commands:
|
|
- cd receiver
|
|
- rustup default stable
|
|
- cargo build --release
|
|
- ls target/release
|
|
|
|
- name: bundle
|
|
commands:
|
|
- cd receiver
|
|
- cargo install cargo-bundle
|
|
- cargo bundle --release
|
|
- mv target/release/bundle/osx/receiver.app ./receiver.app
|
|
- brew install create-dmg
|
|
create-dmg \
|
|
--volname "ok-ready-go-receiver" \
|
|
--window-pos 200 120 \
|
|
--window-size 800 400 \
|
|
--icon-size 100 \
|
|
--icon "receiver.app" 200 190 \
|
|
--hide-extension "receiver.app" \
|
|
--app-drop-link 600 185 \
|
|
"receiver-macos.dmg" \
|
|
"./"
|
|
- name: upload
|
|
environment:
|
|
GITEA_USER:
|
|
from_secret: gitea-user
|
|
GITEA_TOKEN:
|
|
from_secret: gitea-token
|
|
commands:
|
|
- 'curl --user $GITEA_USER:$GITEA_TOKEN --upload-file receiver-macos.dmg https://itsblue.dev/api/packages/dorian/generic/ok-ready-go/$${env:DRONE_COMMIT_SHA}/receiver-macos.dmg'
|
|
depends_on:
|
|
- start-github-action
|
|
---
|
|
kind: pipeline
|
|
type: docker
|
|
name: stop-github-action
|
|
steps:
|
|
- name: cancel and delete workflow
|
|
image: itsblue.dev/plugins/github-workflow-controller
|
|
settings:
|
|
github_token:
|
|
from_secret: github-token
|
|
github_repo: "dorianim/drone-runner"
|
|
workflow_id: "drone.yml"
|
|
workflow_actions: cancel,delete
|
|
depends_on:
|
|
- build-receiver-macos
|
|
trigger:
|
|
status:
|
|
- success
|
|
#- failure
|
|
|
|
---
|
|
kind: pipeline
|
|
type: exec
|
|
name: build-receiver-windows
|
|
platform:
|
|
os: windows
|
|
arch: amd64
|
|
steps:
|
|
- name: build
|
|
environment:
|
|
RUSTFLAGS: '-C target-feature=+crt-static'
|
|
RUSTUP_HOME: 'C:\Users\drone\.rustup'
|
|
commands:
|
|
- cd receiver
|
|
- 'C:\Users\drone\.cargo\bin\cargo.exe build --release --target x86_64-pc-windows-msvc'
|
|
|
|
- name: sign
|
|
commands:
|
|
- 'C:\Program` Files` `(x86`)\Windows` Kits\10\bin\10.0.22621.0\x86\signtool.exe sign /n Itsblue` Development /t http://timestamp.digicert.com /fd SHA256 .\receiver\target\x86_64-pc-windows-msvc\release\receiver.exe'
|
|
|
|
- name: upload
|
|
environment:
|
|
GITEA_USER:
|
|
from_secret: gitea-user
|
|
GITEA_TOKEN:
|
|
from_secret: gitea-token
|
|
commands:
|
|
- 'C:\Program` Files\Git\mingw64\bin\curl.exe --user $${env:GITEA_USER}:$${env:GITEA_TOKEN} --upload-file receiver/target/x86_64-pc-windows-msvc/release/receiver.exe https://itsblue.dev/api/packages/dorian/generic/ok-ready-go/$${env:DRONE_COMMIT_SHA}/receiver-windows.exe'
|
|
trigger:
|
|
ref:
|
|
- refs/tags/v*
|
|
|
|
---
|
|
|
|
kind: pipeline
|
|
name: build-and-deploy-web
|
|
steps:
|
|
- name: build-crypto-helper-web
|
|
image: itsblue.dev/plugins/wasm-pack
|
|
commands:
|
|
- cd crypto_helper
|
|
- wasm-pack build --target no-modules
|
|
- mkdir -p ../web/lib
|
|
- cp pkg/crypto_helper_bg.wasm ../web/lib
|
|
- cp pkg/crypto_helper.js ../web/lib
|
|
|
|
- name: publish
|
|
image: itsblue.dev/plugins/codeberg-pages-deploy
|
|
settings:
|
|
folder: web
|
|
ssh_key:
|
|
from_secret: gitea-ssh-key
|
|
|
|
trigger:
|
|
ref:
|
|
- refs/tags/v*
|
|
|
|
---
|
|
kind: pipeline
|
|
name: release
|
|
depends_on:
|
|
- build-receiver-windows
|
|
- build-receiver-macos
|
|
- build-and-deploy-web
|
|
steps:
|
|
- name: download-receiver
|
|
image: alpine/curl
|
|
commands:
|
|
- curl https://itsblue.dev/api/packages/dorian/generic/ok-ready-go/$DRONE_COMMIT_SHA/receiver-windows.exe -o receiver-windows.exe
|
|
|
|
- name: gitea-release
|
|
image: plugins/gitea-release
|
|
settings:
|
|
base_url: https://itsblue.dev
|
|
api_key:
|
|
from_secret: gitea-token
|
|
files: ./receiver-windows.exe
|
|
|
|
trigger:
|
|
ref:
|
|
- refs/tags/v* |