Skip to content

Commit

Permalink
Fix release-building action
Browse files Browse the repository at this point in the history
  • Loading branch information
ctessum committed Aug 9, 2021
1 parent 7309079 commit afb2b6e
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 36 deletions.
27 changes: 18 additions & 9 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,36 @@ on:
push:
branches:
- 'master'
release:
types: [created]

jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: Set up QEMU
- name: Branch name
id: branch_name
run: |
SOURCE_TAG=${GITHUB_REF#refs/tags/} # Get tag
if [ -z "$SOURCE_TAG" ]
then
SOURCE_TAG=latest # Set tag to 'latest' if not a release
fi
echo ::set-output name=SOURCE_TAG::$SOURCE_TAG
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Login to DockerHub
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
tags: inmap/inmap:latest
tags: inmap/inmap:${{ steps.branch_name.outputs.SOURCE_TAG }}
19 changes: 10 additions & 9 deletions .github/workflows/upload_assets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,22 @@ jobs:
- name: Build code
run: |
echo "GO111MODULE=on" >> $GITHUB_ENV
GOOS=windows GOARCH=amd64 go build -o inmap-windows-amd64.exe
GOOS=linux GOARCH=amd64 go build -o inmap-linux-amd64
GOOS=darwin GOARCH=amd64 go build -o inmap-darwin-amd64
mkdir bin
GOOS=windows GOARCH=amd64 go build -o bin/inmap-windows-amd64.exe
GOOS=linux GOARCH=amd64 go build -o bin/inmap-linux-amd64
GOOS=darwin GOARCH=amd64 go build -o bin/inmap-darwin-amd64
- name: upload artifacts
uses: actions/upload-artifact@master
uses: actions/upload-artifact@v2
with:
name: binaries
path: bin/
if-no-files-found: error

upload:
name: Upload release assets
runs-on: ubuntu-latest
needs: [build]
steps:

- name: Branch name
id: branch_name
run: |
Expand All @@ -42,7 +43,7 @@ jobs:
uses: actions/checkout@v1

- name: Download build artefacts
uses: actions/download-artifact@v1
uses: actions/download-artifact@v2
with:
name: binaries
path: bin/
Expand All @@ -52,9 +53,9 @@ jobs:
SOURCE_TAG: ${{ steps.branch_name.outputs.SOURCE_TAG }}
run: |
mkdir assets
zip assets/inmap-${SOURCE_TAG}-windows-amd64.exe inmap-windows-amd64.exe
zip assets/inmap-${SOURCE_TAG}-linux-amd64 inmap-linux-amd64
zip assets/inmap-${SOURCE_TAG}-darwin-amd64 inmap-darwin-amd64
zip assets/inmap-${SOURCE_TAG}-windows-amd64.exe bin/inmap-windows-amd64.exe
zip assets/inmap-${SOURCE_TAG}-linux-amd64 bin/inmap-linux-amd64
zip assets/inmap-${SOURCE_TAG}-darwin-amd64 bin/inmap-darwin-amd64
sha256sum assets/* > assets/SHASUMS256.txt
- name: Upload release assets
uses: skx/github-action-publish-binaries@master
Expand Down
8 changes: 4 additions & 4 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

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

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

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

1. Commit the results.

1. Run `cmd/inmap/build.sh` to create executables for different platforms.

1. Tag the release version using `git tag v${version}` and push it using `git push origin v${version}`.

1. Create a release on github and add the binary executables and any new input or evaluation data as downloads.
1. Create a release on github and add any new input or evaluation data as downloads.

1. Github actions will automatically add precompiled binaries to the release.
14 changes: 0 additions & 14 deletions cmd/inmap/build.sh

This file was deleted.

0 comments on commit afb2b6e

Please sign in to comment.