diff --git a/.github/workflows/binaries.yml b/.github/workflows/binaries.yml index 40aec54..fd8095c 100644 --- a/.github/workflows/binaries.yml +++ b/.github/workflows/binaries.yml @@ -26,4 +26,46 @@ jobs: upload_url: ${{ github.event.release.upload_url }} asset_path: ./dgit.tar.gz asset_name: dgit-${{ runner.os }}-x86_64.tar.gz - asset_content_type: application/x-gtar \ No newline at end of file + asset_content_type: application/x-gtar + release-linux-arm: + runs-on: ubuntu-18.04 + steps: + - name: checkout code + uses: actions/checkout@v2 + - name: setup Go + uses: actions/setup-go@v2-beta + with: + go-version: '^1.14.0' + - name: compile & make tarballs + run: make tarball-linux-arm + - name: upload armv6 release asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: ./dist/armv6/dgit.tar.gz + asset_name: dgit-Linux-armv6.tar.gz + asset_content_type: application/x-gtar + - name: upload armv7 release asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: ./dist/armv7/dgit.tar.gz + asset_name: dgit-Linux-armv7.tar.gz + asset_content_type: application/x-gtar + - name: upload arm64v8 release asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: ./dist/arm64v8/dgit.tar.gz + asset_name: dgit-Linux-arm64v8.tar.gz + asset_content_type: application/x-gtar + + + + diff --git a/.gitignore b/.gitignore index a5db2a5..616ec60 100644 --- a/.gitignore +++ b/.gitignore @@ -14,5 +14,6 @@ decentragit-remote # Output of the go coverage tool, specifically when used with LiteIDE *.out -# Dependency directories (remove the comment below to include it) vendor/ + +dist/ diff --git a/Makefile b/Makefile index 9b2cabe..37461c0 100644 --- a/Makefile +++ b/Makefile @@ -16,6 +16,16 @@ dgit: go.mod go.sum $(gosources) build: dgit +dist/armv%/dgit: go.mod go.sum $(gosources) + mkdir -p $(@D) + env GOOS=linux GOARCH=arm GOARM=$* go build -o $@ + +dist/arm64v%/dgit: go.mod go.sum $(gosources) + mkdir -p $(@D) + env GOOS=linux GOARCH=arm64 go build -o $@ + +build-linux-arm: dist/armv6/dgit dist/armv7/dgit dist/arm64v8/dgit + $(FIRSTGOPATH)/bin/dgit: dgit cp dgit $(FIRSTGOPATH)/bin/ @@ -25,8 +35,16 @@ $(FIRSTGOPATH)/bin/git-remote-dgit: dgit.tar.gz: dgit git-remote-dgit tar -czvf dgit.tar.gz dgit git-remote-dgit +dist/armv%/dgit.tar.gz: dist/armv%/dgit git-remote-dgit + tar -czvf $@ $^ + +dist/arm64v%/dgit.tar.gz: dist/arm64v%/dgit git-remote-dgit + tar -czvf $@ $^ + tarball: dgit.tar.gz +tarball-linux-arm: dist/armv6/dgit.tar.gz dist/armv7/dgit.tar.gz dist/arm64v8/dgit.tar.gz + install: $(FIRSTGOPATH)/bin/dgit $(FIRSTGOPATH)/bin/git-remote-dgit uninstall: @@ -39,4 +57,4 @@ test: clean: rm -f dgit dgit.tar.gz -.PHONY: all build tarball install uninstall test clean +.PHONY: all build build-linux-arm tarball tarball-linux-arm install uninstall test clean