Skip to content

Commit

Permalink
Add darwin ARM64 build
Browse files Browse the repository at this point in the history
  • Loading branch information
ctessum committed Aug 9, 2021
1 parent e75e19d commit ef4aa70
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ jobs:
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
with:
install: true
- name: Login to DockerHub
uses: docker/login-action@v1
with:
Expand All @@ -36,4 +38,5 @@ jobs:
uses: docker/build-push-action@v2
with:
push: true
platforms: linux/amd64,linux/arm64
tags: inmap/inmap:${{ steps.branch_name.outputs.SOURCE_TAG }}
2 changes: 2 additions & 0 deletions .github/workflows/upload_assets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
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
GOOS=darwin GOARCH=arm64 go build -o bin/inmap-darwin-arm64
- name: upload artifacts
uses: actions/upload-artifact@v2
with:
Expand Down Expand Up @@ -56,6 +57,7 @@ jobs:
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
zip assets/inmap-${SOURCE_TAG}-darwin-arm64 bin/inmap-darwin-arm64
sha256sum assets/* > assets/SHASUMS256.txt
- name: Upload release assets
uses: skx/github-action-publish-binaries@master
Expand Down
8 changes: 5 additions & 3 deletions website/static/blog/2019-04-20-sr/sr_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ def run_sr(emis, model, output_variables, emis_units="tons/year"):
job_name = "run_aqm_%s"%start
emis_file = os.path.join(_tmpdir.name, "%s.shp"%(job_name))
emis.to_file(emis_file)

arch = platform.machine()

version = "1.9.0"

Expand All @@ -78,13 +80,13 @@ def run_sr(emis, model, output_variables, emis_units="tons/year"):
print("Downloading InMAP executable for %s "%ost, end='\r')
if ost == "Windows":
_inmap_exe = os.path.join(_tmpdir.name, "inmap_%s.exe"%version)
_download("https://github.com/spatialmodel/inmap/releases/download/v%s/inmap%swindows-amd64.exe"%(version, version), _inmap_exe)
_download("https://github.com/spatialmodel/inmap/releases/download/v%s/inmap-v%s-windows-%s.exe"%(version, version, arch), _inmap_exe)
elif ost == "Darwin":
_inmap_exe = os.path.join(_tmpdir.name, "inmap_%s"%version)
_download("https://github.com/spatialmodel/inmap/releases/download/v%s/inmap%sdarwin-amd64"%(version, version), _inmap_exe)
_download("https://github.com/spatialmodel/inmap/releases/download/v%s/inmap-v%s-darwin-%s"%(version, version, arch), _inmap_exe)
elif ost == "Linux":
_inmap_exe = os.path.join(_tmpdir.name, "inmap_%s"%version)
_download("https://github.com/spatialmodel/inmap/releases/download/v%s/inmap%slinux-amd64"%(version, version), _inmap_exe)
_download("https://github.com/spatialmodel/inmap/releases/download/v%s/inmap-v%s-linux-%s"%(version, version, arch), _inmap_exe)
else:
raise(OSError("invalid operating system %s"%(ost)))
os.chmod(_inmap_exe, stat.S_IXUSR|stat.S_IRUSR|stat.S_IWUSR)
Expand Down

0 comments on commit ef4aa70

Please sign in to comment.