Skip to content

Commit afb2b6e

Browse files
committed
Fix release-building action
1 parent 7309079 commit afb2b6e

File tree

4 files changed

+32
-36
lines changed

4 files changed

+32
-36
lines changed

.github/workflows/docker.yml

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,36 @@ on:
44
push:
55
branches:
66
- 'master'
7+
release:
8+
types: [created]
79

810
jobs:
911
docker:
1012
runs-on: ubuntu-latest
1113
steps:
12-
-
13-
name: Set up QEMU
14+
- name: Branch name
15+
id: branch_name
16+
run: |
17+
SOURCE_TAG=${GITHUB_REF#refs/tags/} # Get tag
18+
19+
if [ -z "$SOURCE_TAG" ]
20+
then
21+
SOURCE_TAG=latest # Set tag to 'latest' if not a release
22+
fi
23+
24+
echo ::set-output name=SOURCE_TAG::$SOURCE_TAG
25+
- name: Set up QEMU
1426
uses: docker/setup-qemu-action@v1
15-
-
16-
name: Set up Docker Buildx
27+
- name: Set up Docker Buildx
1728
uses: docker/setup-buildx-action@v1
18-
-
19-
name: Login to DockerHub
29+
- name: Login to DockerHub
2030
uses: docker/login-action@v1
2131
with:
2232
username: ${{ secrets.DOCKERHUB_USERNAME }}
2333
password: ${{ secrets.DOCKERHUB_TOKEN }}
24-
-
25-
name: Build and push
34+
- name: Build and push
2635
id: docker_build
2736
uses: docker/build-push-action@v2
2837
with:
2938
push: true
30-
tags: inmap/inmap:latest
39+
tags: inmap/inmap:${{ steps.branch_name.outputs.SOURCE_TAG }}

.github/workflows/upload_assets.yml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,22 @@ jobs:
1717
- name: Build code
1818
run: |
1919
echo "GO111MODULE=on" >> $GITHUB_ENV
20-
GOOS=windows GOARCH=amd64 go build -o inmap-windows-amd64.exe
21-
GOOS=linux GOARCH=amd64 go build -o inmap-linux-amd64
22-
GOOS=darwin GOARCH=amd64 go build -o inmap-darwin-amd64
20+
mkdir bin
21+
GOOS=windows GOARCH=amd64 go build -o bin/inmap-windows-amd64.exe
22+
GOOS=linux GOARCH=amd64 go build -o bin/inmap-linux-amd64
23+
GOOS=darwin GOARCH=amd64 go build -o bin/inmap-darwin-amd64
2324
- name: upload artifacts
24-
uses: actions/upload-artifact@master
25+
uses: actions/upload-artifact@v2
2526
with:
2627
name: binaries
2728
path: bin/
29+
if-no-files-found: error
2830

2931
upload:
3032
name: Upload release assets
3133
runs-on: ubuntu-latest
3234
needs: [build]
3335
steps:
34-
3536
- name: Branch name
3637
id: branch_name
3738
run: |
@@ -42,7 +43,7 @@ jobs:
4243
uses: actions/checkout@v1
4344

4445
- name: Download build artefacts
45-
uses: actions/download-artifact@v1
46+
uses: actions/download-artifact@v2
4647
with:
4748
name: binaries
4849
path: bin/
@@ -52,9 +53,9 @@ jobs:
5253
SOURCE_TAG: ${{ steps.branch_name.outputs.SOURCE_TAG }}
5354
run: |
5455
mkdir assets
55-
zip assets/inmap-${SOURCE_TAG}-windows-amd64.exe inmap-windows-amd64.exe
56-
zip assets/inmap-${SOURCE_TAG}-linux-amd64 inmap-linux-amd64
57-
zip assets/inmap-${SOURCE_TAG}-darwin-amd64 inmap-darwin-amd64
56+
zip assets/inmap-${SOURCE_TAG}-windows-amd64.exe bin/inmap-windows-amd64.exe
57+
zip assets/inmap-${SOURCE_TAG}-linux-amd64 bin/inmap-linux-amd64
58+
zip assets/inmap-${SOURCE_TAG}-darwin-amd64 bin/inmap-darwin-amd64
5859
sha256sum assets/* > assets/SHASUMS256.txt
5960
- name: Upload release assets
6061
uses: skx/github-action-publish-binaries@master

RELEASE.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
This file contains a checklist for steps to take to release a new version of InMAP.
44

5-
1. Update the version number in `framework.go` and in `cmd/inmap/build.sh`.
5+
1. Update the version number in `framework.go`.
66

77
1. Change the version number in `website/static/2019-04-20-sr/sr_util.py`.
88

@@ -12,8 +12,8 @@ This file contains a checklist for steps to take to release a new version of InM
1212

1313
1. Commit the results.
1414

15-
1. Run `cmd/inmap/build.sh` to create executables for different platforms.
16-
1715
1. Tag the release version using `git tag v${version}` and push it using `git push origin v${version}`.
1816

19-
1. Create a release on github and add the binary executables and any new input or evaluation data as downloads.
17+
1. Create a release on github and add any new input or evaluation data as downloads.
18+
19+
1. Github actions will automatically add precompiled binaries to the release.

cmd/inmap/build.sh

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)