build: use go install
Some checks failed
Deploy / deploy (push) Failing after 58s

This commit is contained in:
xuu 2023-10-15 14:27:15 -06:00
parent b7f4d06731
commit ac85e1b52a
Signed by: xuu
GPG Key ID: 8B3B0604F164E04F
3 changed files with 14 additions and 16 deletions

View File

@ -5,7 +5,7 @@
tasks: tasks:
- name: Copy build to remote - name: Copy build to remote
ansible.builtin.copy: ansible.builtin.copy:
src: ../build/sour.is-paste src: ../sour.is-paste
dest: /usr/local/bin/sour.is-paste dest: /usr/local/bin/sour.is-paste
mode: u=rwx,g=rx,o=rx mode: u=rwx,g=rx,o=rx
owner: root owner: root

View File

@ -2,7 +2,7 @@ name: Deploy
on: on:
push: push:
branches: [ "main", "master" ] branches: [ "master" ]
release: release:
types: [ published ] types: [ published ]
@ -11,10 +11,6 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
with:
fetch-depth: 0
fetch-tags: true
- run: apt-get update && apt-get -y install ansible - run: apt-get update && apt-get -y install ansible
- name: Set up Go - name: Set up Go
@ -22,15 +18,17 @@ jobs:
with: with:
go-version: 1.21.1 go-version: 1.21.1
- name: Build - name: Install
run: go build -ldflags "-s -w" -o ./build/sour.is-paste ./cmd/paste run: go install -ldflags "-s -w" go.sour.is/paste/cmd/paste@latest
- run: mv $(go env GOPATH)/bin/paste sour.is-paste
- name: Compress - name: Compress
uses: https://git.sour.is/actions/ghaction-upx@v2.4.0 uses: https://git.sour.is/actions/ghaction-upx@v2.4.0
with: with:
version: latest version: latest
files: | files: |
./build/sour.is-paste ./sour.is-paste
args: -fq args: -fq
- name: Deploy - name: Deploy

2
go.mod
View File

@ -1,4 +1,4 @@
module sour.is/x/paste module go.sour.is/paste
go 1.14 go 1.14