mirror of
https://github.com/hrfee/jfa-go.git
synced 2024-12-23 01:20:11 +00:00
345 lines
8.1 KiB
YAML
345 lines
8.1 KiB
YAML
---
|
|
name: jfa-go
|
|
kind: pipeline
|
|
type: docker
|
|
|
|
steps:
|
|
- name: fetch
|
|
image: docker:git
|
|
commands:
|
|
- git fetch --tags
|
|
- name: release
|
|
image: golang:latest
|
|
environment:
|
|
GITHUB_TOKEN:
|
|
from_secret: github_token
|
|
commands:
|
|
- apt update -y
|
|
- apt install build-essential python3-pip curl software-properties-common sed upx -y
|
|
- (curl -sL https://deb.nodesource.com/setup_14.x | bash -)
|
|
- apt install nodejs
|
|
- curl -sL https://git.io/goreleaser | bash
|
|
trigger:
|
|
event:
|
|
- tag
|
|
branch:
|
|
- main
|
|
---
|
|
name: amd64-docker
|
|
kind: pipeline
|
|
type: docker
|
|
steps:
|
|
- name: fetch
|
|
image: docker:git
|
|
commands:
|
|
- git fetch --tags
|
|
- name: build
|
|
image: plugins/docker
|
|
settings:
|
|
username: hrfee
|
|
password:
|
|
from_secret: docker_key
|
|
repo: hrfee/jfa-go
|
|
tags: manifest-latest-amd64
|
|
trigger:
|
|
event:
|
|
- tag
|
|
branch:
|
|
- main
|
|
---
|
|
name: arm64-docker
|
|
kind: pipeline
|
|
type: docker
|
|
|
|
steps:
|
|
- name: arm64-ssh
|
|
image: appleboy/drone-ssh
|
|
volumes:
|
|
- name: ssh_key
|
|
path: /root/drone_rsa
|
|
settings:
|
|
host:
|
|
from_secret: ssh_host
|
|
username:
|
|
from_secret: ssh_username
|
|
port:
|
|
from_secret: ssh_port
|
|
volumes:
|
|
- /root/.ssh/docker-build:/root/drone_rsa
|
|
key_path: /root/drone_rsa
|
|
command_timeout: 50m
|
|
script:
|
|
- /home/rock64/jfa-go-build/build-stable.sh
|
|
trigger:
|
|
event:
|
|
- tag
|
|
branch:
|
|
- main
|
|
volumes:
|
|
- name: ssh_key
|
|
host:
|
|
path: /root/.ssh/docker-build
|
|
---
|
|
name: armhf-docker
|
|
kind: pipeline
|
|
type: docker
|
|
|
|
steps:
|
|
- name: armhf-ssh
|
|
image: appleboy/drone-ssh
|
|
volumes:
|
|
- name: ssh_key
|
|
path: /root/drone_rsa
|
|
settings:
|
|
host:
|
|
from_secret: ssh_host
|
|
username:
|
|
from_secret: ssh_username
|
|
port:
|
|
from_secret: ssh_port
|
|
volumes:
|
|
- /root/.ssh/docker-build:/root/drone_rsa
|
|
key_path: /root/drone_rsa
|
|
command_timeout: 50m
|
|
script:
|
|
- ssh pi /home/pi/jfa-go-build/build-stable.sh
|
|
trigger:
|
|
event:
|
|
- tag
|
|
branch:
|
|
- main
|
|
volumes:
|
|
- name: ssh_key
|
|
host:
|
|
path: /root/.ssh/docker-build
|
|
---
|
|
name: docker-manifest
|
|
kind: pipeline
|
|
type: docker
|
|
|
|
steps:
|
|
- name: manifest
|
|
image: appleboy/drone-ssh
|
|
volumes:
|
|
- name: ssh_key
|
|
path: /root/drone_rsa
|
|
settings:
|
|
host:
|
|
from_secret: ssh_host
|
|
username:
|
|
from_secret: ssh_username
|
|
port:
|
|
from_secret: ssh_port
|
|
volumes:
|
|
- /root/.ssh/docker-build:/root/drone_rsa
|
|
key_path: /root/drone_rsa
|
|
command_timeout: 50m
|
|
script:
|
|
- docker pull hrfee/jfa-go:manifest-latest-amd64
|
|
- docker pull hrfee/jfa-go:manifest-latest-arm64
|
|
- docker pull hrfee/jfa-go:manifest-latest-armhf
|
|
- env DOCKER_CLI_EXPERIMENTAL=enabled docker manifest create hrfee/jfa-go:latest --amend hrfee/jfa-go:manifest-latest-amd64 --amend hrfee/jfa-go:manifest-latest-arm64 --amend hrfee/jfa-go:manifest-latest-armhf
|
|
- env DOCKER_CLI_EXPERIMENTAL=enabled docker manifest push hrfee/jfa-go:latest
|
|
trigger:
|
|
event:
|
|
- tag
|
|
branch:
|
|
- main
|
|
volumes:
|
|
- name: ssh_key
|
|
host:
|
|
path: /root/.ssh/docker-build
|
|
depends_on:
|
|
- amd64-docker
|
|
- arm64-docker
|
|
- armhf-docker
|
|
---
|
|
name: jfa-go-git
|
|
kind: pipeline
|
|
type: docker
|
|
|
|
steps:
|
|
- name: build
|
|
image: golang:latest
|
|
commands:
|
|
- apt update -y
|
|
- apt install build-essential python3-pip curl software-properties-common sed upx -y
|
|
- (curl -sL https://deb.nodesource.com/setup_14.x | bash -)
|
|
- apt install nodejs
|
|
- curl -sL https://git.io/goreleaser > goreleaser.sh
|
|
- chmod +x goreleaser.sh
|
|
- ./goreleaser.sh --snapshot --skip-publish --rm-dist
|
|
- wget https://builds.hrfee.pw/upload.py
|
|
- pip3 install requests
|
|
- bash -c 'python3 upload.py https://builds.hrfee.pw hrfee jfa-go ./dist/*.tar.gz'
|
|
environment:
|
|
BUILDRONE_KEY:
|
|
from_secret: BUILDRONE_KEY
|
|
|
|
trigger:
|
|
branch:
|
|
- main
|
|
- go1.16
|
|
event:
|
|
exclude:
|
|
- pull_request
|
|
|
|
---
|
|
name: amd64-docker-git
|
|
kind: pipeline
|
|
type: docker
|
|
steps:
|
|
- name: build
|
|
image: plugins/docker
|
|
settings:
|
|
username: hrfee
|
|
password:
|
|
from_secret: docker_key
|
|
repo: hrfee/jfa-go
|
|
tags: manifest-unstable-amd64
|
|
|
|
trigger:
|
|
branch:
|
|
- main
|
|
event:
|
|
exclude:
|
|
- pull_request
|
|
|
|
---
|
|
name: arm64-docker-git
|
|
kind: pipeline
|
|
type: docker
|
|
|
|
steps:
|
|
- name: arm64-ssh
|
|
image: appleboy/drone-ssh
|
|
volumes:
|
|
- name: ssh_key
|
|
path: /root/drone_rsa
|
|
settings:
|
|
host:
|
|
from_secret: ssh_host
|
|
username:
|
|
from_secret: ssh_username
|
|
port:
|
|
from_secret: ssh_port
|
|
volumes:
|
|
- /root/.ssh/docker-build:/root/drone_rsa
|
|
key_path: /root/drone_rsa
|
|
command_timeout: 50m
|
|
script:
|
|
- /home/rock64/jfa-go-build/build.sh
|
|
|
|
trigger:
|
|
branch:
|
|
- main
|
|
event:
|
|
exclude:
|
|
- pull_request
|
|
|
|
volumes:
|
|
- name: ssh_key
|
|
host:
|
|
path: /root/.ssh/docker-build
|
|
---
|
|
name: armhf-docker-git
|
|
kind: pipeline
|
|
type: docker
|
|
|
|
steps:
|
|
- name: armhf-ssh
|
|
image: appleboy/drone-ssh
|
|
volumes:
|
|
- name: ssh_key
|
|
path: /root/drone_rsa
|
|
settings:
|
|
host:
|
|
from_secret: ssh_host
|
|
username:
|
|
from_secret: ssh_username
|
|
port:
|
|
from_secret: ssh_port
|
|
volumes:
|
|
- /root/.ssh/docker-build:/root/drone_rsa
|
|
key_path: /root/drone_rsa
|
|
command_timeout: 50m
|
|
script:
|
|
- ssh pi /home/pi/jfa-go-build/build.sh
|
|
|
|
trigger:
|
|
branch:
|
|
- main
|
|
event:
|
|
exclude:
|
|
- pull_request
|
|
|
|
volumes:
|
|
- name: ssh_key
|
|
host:
|
|
path: /root/.ssh/docker-build
|
|
---
|
|
name: docker-manifest-unstable
|
|
kind: pipeline
|
|
type: docker
|
|
|
|
steps:
|
|
- name: manifest
|
|
image: appleboy/drone-ssh
|
|
volumes:
|
|
- name: ssh_key
|
|
path: /root/drone_rsa
|
|
settings:
|
|
host:
|
|
from_secret: ssh2_host
|
|
username:
|
|
from_secret: ssh2_username
|
|
port:
|
|
from_secret: ssh2_port
|
|
volumes:
|
|
- /root/.ssh/docker-build:/root/drone_rsa
|
|
key_path: /root/drone_rsa
|
|
command_timeout: 50m
|
|
script:
|
|
- docker pull hrfee/jfa-go:manifest-unstable-amd64
|
|
- docker pull hrfee/jfa-go:manifest-unstable-arm64
|
|
- docker pull hrfee/jfa-go:manifest-unstable-armhf
|
|
- env DOCKER_CLI_EXPERIMENTAL=enabled docker manifest create hrfee/jfa-go:unstable --amend hrfee/jfa-go:manifest-unstable-amd64 --amend hrfee/jfa-go:manifest-unstable-arm64 --amend hrfee/jfa-go:manifest-unstable-armhf
|
|
- env DOCKER_CLI_EXPERIMENTAL=enabled docker manifest push hrfee/jfa-go:unstable
|
|
depends_on:
|
|
- amd64-docker-git
|
|
- arm64-docker-git
|
|
- armhf-docker-git
|
|
trigger:
|
|
branch:
|
|
- main
|
|
event:
|
|
exclude:
|
|
- pull_request
|
|
|
|
volumes:
|
|
- name: ssh_key
|
|
host:
|
|
path: /root/.ssh/docker-build
|
|
---
|
|
name: jfa-go-pr
|
|
kind: pipeline
|
|
type: docker
|
|
|
|
steps:
|
|
- name: build
|
|
image: golang:latest
|
|
commands:
|
|
- apt update -y
|
|
- apt install build-essential python3-pip curl software-properties-common sed upx -y
|
|
- (curl -sL https://deb.nodesource.com/setup_14.x | bash -)
|
|
- apt install nodejs
|
|
- curl -sL https://git.io/goreleaser > goreleaser.sh
|
|
- chmod +x goreleaser.sh
|
|
- ./goreleaser.sh --snapshot --skip-publish --rm-dist
|
|
|
|
trigger:
|
|
event:
|
|
include:
|
|
- pull_request
|
|
|