Skip to content

Commit

Permalink
adds working CI actions
Browse files Browse the repository at this point in the history
  • Loading branch information
audibleblink committed Jul 30, 2020
1 parent 79b15b0 commit 93649e1
Show file tree
Hide file tree
Showing 11 changed files with 59 additions and 35 deletions.
28 changes: 0 additions & 28 deletions .github/workflows/go.yml

This file was deleted.

46 changes: 46 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
on:
push:
tags:
- 'v*'

name: Build and Release

jobs:

release:
runs-on: ubuntu-latest
steps:

- name: Checkout
uses: actions/checkout@master

- name: Build
uses: audibleblink/[email protected]
with:
args: make linux

- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.get_version.outputs.VERSION }}
release_name: Release ${{ steps.get_version.outputs.VERSION }}
draft: false
prerelease: false

- name: Upload Linux Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./release/letsproxy.linux
asset_name: letsproxy.bin
asset_content_type: application/zip

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
release
19 changes: 12 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
.PHONY: all clean
APP = letsproxy
DIR = release

DIR = bin
OUT = ${DIR}/{{.OS}}_{{.Arch}}
GOFLAGS=-trimpath -ldflags="-s -w -buildid="
OSARCH ?= "linux/amd64 linux/386 linux/arm windows/amd64 windows/386 darwin/amd64 darwin/386"
FLAGS=-trimpath -ldflags="-s -w -buildid="

all:
gox -osarch ${OSARCH} ${GOFLAGS} -output ${OUT}
PLATFORMS ?= linux windows darwin
os = $(word 1, $@)


all: ${PLATFORMS}

${PLATFORMS}:
GOOS=${os} \
go build ${FLAGS} -o ${DIR}/${APP}.${os}

clean:
rm -rf ${DIR}
Expand Down
Binary file removed bin/darwin_386
Binary file not shown.
Binary file removed bin/darwin_amd64
Binary file not shown.
Binary file removed bin/linux_386
Binary file not shown.
Binary file removed bin/linux_amd64
Binary file not shown.
Binary file removed bin/linux_arm
Binary file not shown.
Binary file removed bin/windows_386.exe
Binary file not shown.
Binary file removed bin/windows_amd64.exe
Binary file not shown.

0 comments on commit 93649e1

Please sign in to comment.