diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 2bd02af79..27202c298 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -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 \ No newline at end of file + tags: inmap/inmap:${{ steps.branch_name.outputs.SOURCE_TAG }} \ No newline at end of file diff --git a/.github/workflows/upload_assets.yml b/.github/workflows/upload_assets.yml index d20c256d2..c432cce71 100644 --- a/.github/workflows/upload_assets.yml +++ b/.github/workflows/upload_assets.yml @@ -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: | @@ -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/ @@ -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 diff --git a/RELEASE.md b/RELEASE.md index 02a7b64cd..ab29664e1 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -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`. @@ -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. \ No newline at end of file diff --git a/cmd/inmap/build.sh b/cmd/inmap/build.sh deleted file mode 100755 index bab49e33e..000000000 --- a/cmd/inmap/build.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -# This script compiles InMAP for different systems. - -version=1.9.0 - -env GOOS=linux GOARCH=amd64 go build -v -mv inmap inmap${version}linux-amd64 - -env GOOS=darwin GOARCH=amd64 go build -v -mv inmap inmap${version}darwin-amd64 - -env GOOS=windows GOARCH=amd64 go build -v -mv inmap.exe inmap${version}windows-amd64.exe