build: add ci for tag

This commit is contained in:
Alexander Baryshnikov 2020-09-10 18:26:22 +08:00
parent 4edfaa4d26
commit 89f86e9fe6
3 changed files with 82 additions and 0 deletions

12
.github/FUNDING.yml vendored Normal file
View File

@ -0,0 +1,12 @@
# These are supported funding model platforms
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: ['http://reddec.net/about/#donate']

40
.github/workflows/go.yml vendored Normal file
View File

@ -0,0 +1,40 @@
name: Build project
on:
push:
tags:
- 'v*'
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.15
uses: actions/setup-go@v1
with:
go-version: '^1.15'
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
with:
lfs: true
fetch-depth: 0
- name: Checkout LFS objects
run: git lfs checkout
- name: Pull tag
run: git fetch --tags
- uses: azure/docker-login@v1
with:
username: 'reddec'
password: ${{ secrets.DOCKERIO_PASSWORD }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist --release-footer _footer.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
UPLOAD_BINTRAY_SECRET: ${{ secrets.UPLOAD_BINTRAY_SECRET }}

30
_footer.md Normal file
View File

@ -0,0 +1,30 @@
For Ubuntu/Debian (should be for all LTS)
```bash
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 379CE192D401AB61
echo "deb https://dl.bintray.com/reddec/debian all main" | sudo tee /etc/apt/sources.list.d/reddec.list
sudo apt update
sudo apt install nano-run
```
Ansible snippet
```yaml
- name: Add an apt key by id from a keyserver
become: yes
apt_key:
keyserver: keyserver.ubuntu.com
id: 379CE192D401AB61
- name: Add repository
become: yes
apt_repository:
repo: deb https://dl.bintray.com/reddec/debian all main
state: present
filename: reddec
- name: Install nano-run
become: yes
apt:
name: nano-run
update_cache: yes
state: latest
```