Skip to content

Commit df178a3

Browse files
committed
Release linux binary
1 parent 73ff763 commit df178a3

File tree

3 files changed

+30
-8
lines changed

3 files changed

+30
-8
lines changed

.github/workflows/master.yml

+26-8
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,30 @@ jobs:
66
runs-on: ubuntu-latest
77
steps:
88
- uses: actions/checkout@master
9-
- name: build + push
9+
- name: build
1010
run: |
11-
version=$(date "+%Y-%m-%d")-$(git --no-pager log -1 --pretty=%h)
12-
gpr_image_prefix=docker.pkg.github.com/nais/device/apiserver
13-
docker build -t ${gpr_image_prefix}:latest -t ${gpr_image_prefix}:${version} .
14-
echo ${{ secrets.GITHUB_TOKEN }} | docker login docker.pkg.github.com --username x-access-token --password-stdin
15-
docker push ${gpr_image_prefix}:latest
16-
docker push ${gpr_image_prefix}:${version}
17-
11+
make linux
12+
- name: set version
13+
id: set_version
14+
run: |
15+
echo ::set-output name=version::$(date "+%Y-%m-%d")-$(git --no-pager log -1 --pretty=%h)
16+
- name: create release
17+
id: create_release
18+
uses: actions/[email protected]
19+
env:
20+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21+
with:
22+
tag_name: ${{ steps.set_version.outputs.version }}
23+
release_name: Release ${{ steps.set_version.outputs.version }}
24+
draft: false
25+
prerelease: true
26+
- name: upload binary
27+
id: upload-release
28+
uses: actions/[email protected]
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
with:
32+
upload_url: ${{ steps.create_release.outputs.upload_url }}
33+
asset_path: ./bin/apiserver
34+
asset_name: apiserver-${{ steps.set_version.outputs.version }}
35+
asset_content_type: application/octet-stream

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
.idea/
2+
bin

Makefile

+3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ all: test alpine
55
alpine:
66
go build -a -installsuffix cgo -o bin/apiserver cmd/apiserver/main.go
77

8+
linux:
9+
GOOS=linux GOARCH=amd64 go build -o bin/apiserver cmd/apiserver/main.go
10+
811
local-apiserver:
912
go run ./cmd/apiserver/main.go --db-connection-uri=${DB_CONNECTION_URI} || echo "forget to export DB_CONNECTION_URL=<DSN> ?"
1013

0 commit comments

Comments
 (0)