ok-ready-go/.drone.yml

130 lines
3 KiB
YAML
Raw Normal View History

2023-02-18 10:31:50 +01:00
---
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: test
commands:
- cd receiver
2023-02-18 10:38:35 +01:00
- rustup default stabe
2023-02-18 10:31:50 +01:00
- cargo build --release
- ls target/release
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:
2023-02-18 10:33:41 +01:00
- build-receiver-macos
2023-02-18 10:31:50 +01:00
trigger:
status:
- success
#- failure
---
2023-02-17 19:39:25 +01:00
kind: pipeline
type: exec
name: build-receiver-windows
2023-02-16 11:47:48 +01:00
platform:
os: windows
2023-02-16 11:58:32 +01:00
arch: amd64
2023-02-16 11:47:48 +01:00
steps:
2023-02-16 12:53:36 +01:00
- name: build
2023-02-16 12:09:56 +01:00
environment:
RUSTFLAGS: '-C target-feature=+crt-static'
2023-02-17 20:50:41 +01:00
RUSTUP_HOME: 'C:\Users\drone\.rustup'
2023-02-16 11:47:48 +01:00
commands:
2023-02-16 12:23:58 +01:00
- cd receiver
2023-02-17 20:51:24 +01:00
- 'C:\Users\drone\.cargo\bin\cargo.exe build --release --target x86_64-pc-windows-msvc'
2023-02-16 11:47:48 +01:00
2023-02-17 19:16:03 +01:00
- name: sign
commands:
2023-02-17 20:23:56 +01:00
- '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'
2023-02-17 19:16:03 +01:00
2023-02-16 12:53:36 +01:00
- name: upload
environment:
GITEA_USER:
from_secret: gitea-user
GITEA_TOKEN:
from_secret: gitea-token
commands:
2023-02-17 20:23:56 +01:00
- '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'
2023-02-17 20:57:30 +01:00
trigger:
ref:
- refs/tags/v*
2023-02-16 20:51:34 +01:00
---
kind: pipeline
2023-02-16 21:55:06 +01:00
name: build-and-deploy-web
2023-02-16 20:51:34 +01:00
steps:
- name: build-crypto-helper-web
2023-02-16 21:55:06 +01:00
image: itsblue.dev/plugins/wasm-pack
2023-02-16 20:51:34 +01:00
commands:
- cd crypto_helper
2023-02-16 22:04:21 +01:00
- wasm-pack build --target no-modules
2023-02-16 20:51:34 +01:00
- 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:
2023-02-16 21:58:56 +01:00
folder: web
2023-02-16 20:51:34 +01:00
ssh_key:
2023-02-17 15:20:18 +01:00
from_secret: gitea-ssh-key
2023-02-17 16:16:23 +01:00
trigger:
ref:
- refs/tags/v*
2023-02-17 16:18:14 +01:00
2023-02-17 15:20:18 +01:00
---
kind: pipeline
name: release
depends_on:
- build-receiver-windows
2023-02-18 10:33:41 +01:00
- build-receiver-macos
2023-02-17 15:20:18 +01:00
- 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*