diff --git a/.github/workflows/makefile.yml b/.github/workflows/makefile.yml index ab3da7e..83c57b4 100644 --- a/.github/workflows/makefile.yml +++ b/.github/workflows/makefile.yml @@ -61,8 +61,11 @@ jobs: - name: Build binary on Linux if: matrix.os == 'ubuntu-latest' run: | - make linux + make linux MAINTAINER_NAME="$MAINTAINER_NAME" MAINTAINER_EMAIL="$MAINTAINER_EMAIL" shell: bash + env: + MAINTAINER_NAME: ${{ vars.MAINTAINER_NAME }} + MAINTAINER_EMAIL: ${{ vars.MAINTAINER_EMAIL }} - name: Build binary on macOS if: matrix.os == 'macos-latest' @@ -86,3 +89,21 @@ jobs: asset_content_type: application/octet-stream env: GITHUB_TOKEN: ${{ secrets.LOOM_RELEASE }} + + - name: Get Latest Release Upload URL + if: github.event_name != 'release' + run: | + upload_url="$(curl -sL https://api.github.com/repos/broccolimicro/loom/releases | jq -r 'map(select(.prerelease)) | first | .upload_url')" + echo UPLOAD_URL=$upload_url >> $GITHUB_ENV + shell: bash + + - name: Upload Latest Release Asset + if: github.event_name != 'release' + uses: actions/upload-release-asset@v1 + with: + upload_url: ${{ env.UPLOAD_URL }} + asset_path: ${{ matrix.from }} + asset_name: ${{ matrix.to }} + asset_content_type: application/octet-stream + env: + GITHUB_TOKEN: ${{ secrets.LOOM_RELEASE }} diff --git a/Makefile b/Makefile index 28a0524..6b6d7b0 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,6 @@ else UNAME_S := $(shell uname -s) endif - # Use + instead of spaces in the below list LIBS = \ lib/common \ @@ -37,6 +36,9 @@ LIBS = \ lib/interpret_chp \ bin/ckt +MAINTAINER_NAME = $(shell git config user.name) +MAINTAINER_EMAIL = $(shell git config user.email) + all: lib linux: lib @@ -51,7 +53,7 @@ linux: lib echo "Priority: optional" >> lm-linux/DEBIAN/control echo "Architecture: amd64" >> lm-linux/DEBIAN/control dpkg-shlibdeps -O lm-linux/usr/local/bin/lm | sed 's/.*Depends=/Depends: /g' >> lm-linux/DEBIAN/control - git config user.email | xargs -I{} echo "Maintainer: Edward Bingham <{}>" >> lm-linux/DEBIAN/control + echo "Maintainer: $(MAINTAINER_NAME) <$(MAINTAINER_EMAIL)>" >> lm-linux/DEBIAN/control echo "Description: Loom" >> lm-linux/DEBIAN/control echo " A programming language for quasi-delay insensitive asynchronous circuits" >> lm-linux/DEBIAN/control dpkg-deb --build --root-owner-group lm-linux