-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.drone.yml
85 lines (77 loc) · 3.43 KB
/
.drone.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
---
kind: pipeline
type: ssh
name: default
server:
host:
from_secret: ssh_host
user:
from_secret: ssh_username
ssh_key:
from_secret: ssh_key
steps:
- name: cli-win-x64
commands:
- dotnet publish -c Release -r win-x64 --self-contained true -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -p:PublishTrimmed=True -p:TrimMode=link src/Albumin.sln
- zip -j "bin/Release/net6.0/win-x64/publish/release.zip" "bin/Release/net6.0/win-x64/publish/albumin.exe" "CHANGELOG.md" "README.md" "USAGE.md"
- name: cli-linux-x64
commands:
- dotnet publish -c Release -r linux-x64 --self-contained true -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -p:PublishTrimmed=True -p:TrimMode=link src/Albumin.sln
- zip -j "bin/Release/net6.0/linux-x64/publish/release.zip" "bin/Release/net6.0/linux-x64/publish/albumin" "CHANGELOG.md" "README.md" "USAGE.md"
- name: cli-osx-x64
commands:
- dotnet publish -c Release -r osx-x64 --self-contained true -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -p:PublishTrimmed=True -p:TrimMode=link src/Albumin.sln
- zip -j "bin/Release/net6.0/osx-x64/publish/release.zip" "bin/Release/net6.0/osx-x64/publish/albumin" "CHANGELOG.md" "README.md" "USAGE.md"
- name: gui-docker
environment:
DOCKER_IMAGE_PHP:
from_secret: docker_image_php
DOCKER_IMAGE_CADDY:
from_secret: docker_image_caddy
commands:
- export DOCKER_BUILDKIT=1
- docker-compose -f gui/docker-compose.yml build
# semver
- docker tag "$DOCKER_IMAGE_PHP:latest" "$DOCKER_IMAGE_PHP:$DRONE_SEMVER" || echo "skipping semver tag"
- docker tag "$DOCKER_IMAGE_CADDY:latest" "$DOCKER_IMAGE_CADDY:$DRONE_SEMVER" || echo "skipping semver tag"
- name: publish-cli
environment:
REGISTRY_HOST:
from_secret: registry_host
REGISTRY_USERNAME:
from_secret: registry_username
REGISTRY_PASSWORD:
from_secret: registry_password
commands:
- curl --user "$REGISTRY_USERNAME:$REGISTRY_PASSWORD" --upload-file "bin/Release/net6.0/linux-x64/publish/release.zip" "https://$REGISTRY_HOST/api/packages/albumin/generic/cli/$DRONE_SEMVER/albumin-$DRONE_SEMVER-linux-x64.zip"
- curl --user "$REGISTRY_USERNAME:$REGISTRY_PASSWORD" --upload-file "bin/Release/net6.0/win-x64/publish/release.zip" "https://$REGISTRY_HOST/api/packages/albumin/generic/cli/$DRONE_SEMVER/albumin-$DRONE_SEMVER-win-x64.zip"
- curl --user "$REGISTRY_USERNAME:$REGISTRY_PASSWORD" --upload-file "bin/Release/net6.0/osx-x64/publish/release.zip" "https://$REGISTRY_HOST/api/packages/albumin/generic/cli/$DRONE_SEMVER/albumin-$DRONE_SEMVER-osx-x64.zip"
depends_on:
- cli-win-x64
- cli-linux-x64
- cli-osx-x64
- name: publish-gui
environment:
DOCKER_IMAGE_PHP:
from_secret: docker_image_php
DOCKER_IMAGE_CADDY:
from_secret: docker_image_caddy
REGISTRY_HOST:
from_secret: registry_host
REGISTRY_USERNAME:
from_secret: registry_username
REGISTRY_PASSWORD:
from_secret: registry_password
commands:
- docker login --username "$REGISTRY_USERNAME" --password "$REGISTRY_PASSWORD" "$REGISTRY_HOST"
# latest
- docker push "$DOCKER_IMAGE_PHP:latest"
- docker push "$DOCKER_IMAGE_CADDY:latest"
# semver
- docker push "$DOCKER_IMAGE_PHP:$DRONE_SEMVER" || echo "skipping semver push"
- docker push "$DOCKER_IMAGE_CADDY:$DRONE_SEMVER" || echo "skipping semver push"
depends_on:
- gui-docker
trigger:
event:
- tag