2020-11-02 02:37:38 +08:00
on :
release :
types : [ published]
name : release
jobs :
release :
name : release
runs-on : ubuntu-latest
steps :
- name : Get release
id : get_release
2021-08-31 04:30:46 +08:00
uses : bruceadams/get-release@v1.2.3
2020-11-02 02:37:38 +08:00
env :
GITHUB_TOKEN : ${{ github.token }}
- name : Checkout repo
2021-06-30 20:37:24 +08:00
uses : actions/checkout@v2.3.4
2020-11-02 02:37:38 +08:00
with :
fetch-depth : 0
- name : Set up Go
uses : actions/setup-go@v2
with :
go-version : ^1.15
- name : Build binaries
run : go run build/build.go
2021-01-23 03:48:30 +08:00
- name : Get release from tag
run : echo ::set-output name=RELEASE_VERSION::$(echo ${GITHUB_REF:11})
id : versioner
- name : Create target directory
run : mkdir -p usr/bin
- name : Copy Linux version to dnscontrol
run : cp dnscontrol-Linux usr/bin/dnscontrol
- name : Bundle RPM
uses : bpicode/github-action-fpm@master
with :
fpm_args : 'usr/'
2021-06-10 23:38:23 +08:00
fpm_opts : '-n dnscontrol -t rpm -s dir -v ${{ steps.versioner.outputs.RELEASE_VERSION }} --license "The MIT License (MIT)" --url "https://dnscontrol.org/" --description "DNSControl: Infrastructure as Code for DNS Zones"'
2021-01-23 03:48:30 +08:00
- name : Bundle DEB
uses : bpicode/github-action-fpm@master
with :
fpm_args : 'usr/'
2021-06-10 23:38:23 +08:00
fpm_opts : '-n dnscontrol -t deb -s dir -v ${{ steps.versioner.outputs.RELEASE_VERSION }} --license "The MIT License (MIT)" --url "https://dnscontrol.org/" --description "DNSControl: Infrastructure as Code for DNS Zones"'
2021-01-23 03:48:30 +08:00
2020-11-02 02:37:38 +08:00
- name : Upload dnscontrol-Darwin
uses : actions/upload-release-asset@v1
env :
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
with :
2021-06-10 23:38:23 +08:00
upload_url : ${{ steps.get_release.outputs.upload_url }}
2020-11-02 02:37:38 +08:00
asset_path : ./dnscontrol-Darwin
asset_name : dnscontrol-Darwin
asset_content_type : application/octet-stream
- name : Upload dnscontrol-Linux
uses : actions/upload-release-asset@v1
env :
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
with :
2021-06-10 23:38:23 +08:00
upload_url : ${{ steps.get_release.outputs.upload_url }}
2020-11-02 02:37:38 +08:00
asset_path : ./dnscontrol-Linux
asset_name : dnscontrol-Linux
asset_content_type : application/octet-stream
- name : Upload dnscontrol.exe
uses : actions/upload-release-asset@v1
env :
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
with :
2021-06-10 23:38:23 +08:00
upload_url : ${{ steps.get_release.outputs.upload_url }}
2020-11-02 02:37:38 +08:00
asset_path : ./dnscontrol.exe
asset_name : dnscontrol.exe
asset_content_type : application/octet-stream
2021-01-23 03:48:30 +08:00
- name : Upload RPM
uses : actions/upload-release-asset@v1
env :
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
with :
2021-06-10 23:38:23 +08:00
upload_url : ${{ steps.get_release.outputs.upload_url }}
2021-01-23 03:48:30 +08:00
asset_path : dnscontrol-${{ steps.versioner.outputs.RELEASE_VERSION }}-1.x86_64.rpm
asset_name : dnscontrol-${{ steps.versioner.outputs.RELEASE_VERSION }}-1.x86_64.rpm
asset_content_type : application/x-rpm
- name : Upload DEB
uses : actions/upload-release-asset@v1
env :
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
with :
2021-06-10 23:38:23 +08:00
upload_url : ${{ steps.get_release.outputs.upload_url }}
2021-01-23 03:48:30 +08:00
asset_path : dnscontrol_${{ steps.versioner.outputs.RELEASE_VERSION }}_amd64.deb
asset_name : dnscontrol_${{ steps.versioner.outputs.RELEASE_VERSION }}_amd64.deb
asset_content_type : application/vnd.debian.binary-package