From ba2fb1af2044e97122d9b85c849c025604976ef4 Mon Sep 17 00:00:00 2001 From: Dan Galdi Date: Wed, 27 Apr 2022 13:50:37 -0400 Subject: [PATCH] Begin porting travis workflows (#25) * Begin porting travis workflows * Fix github target name * Fix github-release target name * Only publish tarred files in release * Removed travis config --- .github/workflows/release.yml | 52 +++++++++++++++++++++++++++++++++++ .travis.yml | 24 ---------------- makefile | 16 +++++------ 3 files changed, 60 insertions(+), 32 deletions(-) create mode 100644 .github/workflows/release.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..8289cac --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,52 @@ +name: Release + +on: + push: + tags: + - v* + +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - name: Get Release Version + id: version_num + run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d/ -f3) + + - name: Set up Go 1.x + uses: actions/setup-go@v2 + with: + go-version: ^1.14 + + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + + - name: Build + run: make GH_TAG=${{ steps.version_num.outputs.VERSION }} gh-release + + - name: Create Draft Release + uses: actions/create-release@v1 + id: draft + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ steps.version_num.outputs.VERSION }} + release_name: Version ${{ steps.version_num.outputs.VERSION }} + draft: true + prerelease: false + + - name: Publish Binaries + uses: skx/github-action-publish-binaries@release-0.14 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + releaseId: ${{ steps.draft.outputs.id }} + args: 'bin/*' + + - name: Publish Release + uses: eregon/publish-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + release_id: ${{ steps.draft.outputs.id }} \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index e448ab6..0000000 --- a/.travis.yml +++ /dev/null @@ -1,24 +0,0 @@ -language: go - -go: - - 1.14.x - -env: - - GO111MODULE=on - -script: - - make travis - - ls -l bin - -deploy: - provider: releases - api_key: - secure: SKyXzIRIUCQ769fKVqpfKVSptKTBMgdX4j34W9wpIQ8/u11L85EQr2fl59Ziai1nLuKC6RFHG2MS/uBJkZWMA1mVP6JNxZ28BZuoWd3PwBMZc2TUrDuRwYEU+h8b1Hxlq5kpOdI3A9TnRZgJHBISD07yW2K340nr2ihmILzGEIMW0nr5fytW/+bG2gLTiS0tGvhq44BgQu2Db8wE0LChYaq46s1PZxO2cU8o+44W/cu5P2Oz0VMQQYZtTy3t5UtcidsIKUFOAybvfRXwVsk9oZNniQM5J7mH08QLYBmwNKpTJkpdcbzyFp40q+QMLtuBf6z+bainQIBb3CBSDJmJJEwFyRNNUfob3KRwiCxYwpOTbTxIh9L+YY8FxjciK70AEQ+RvPMQFR0HZkCn2AhTiDG+4PqI2BKrxx3nvxzIY+02/i5LslVwGSKUi5Y+D+7nGkMLeNXbV0m7VFdmcRyZN6ClL6zsyOhbpgzzPst1LZVKMBPmN+pZ4LbofW4p0X39Ezy+UypYGrcwkuZdNXfm8UQq+hi6LrGZwM4Q7cLPY524UVyXPPchJtKB0TjDnVeMgVToUe6JV65XdrKKgzmJoXqZn2H520HIDd0LTHqZ4z2wY/B4dynQwtSmnuvfz/bJhA+TBiY11uWhWnB36E5xxOooijQqYWFN/YtVhTZe3bs= - file: - - bin/server-${TRAVIS_TAG}.tar.gz - - bin/gen-config-${TRAVIS_TAG}.tar.gz - - bin/check-config-${TRAVIS_TAG}.tar.gz - on: - repo: VEuPathDB/util-user-dataset-handler-server - tags: true - skip_cleanup: 'true' diff --git a/makefile b/makefile index ca2a4ac..d6b081e 100644 --- a/makefile +++ b/makefile @@ -24,8 +24,8 @@ build: bin/server bin/static-content/index.html build-all: bin/server bin/static-content/index.html bin/gen-config bin/check-config # Build all release packages -.PHONY: travis -travis: bin/server-${TRAVIS_TAG}.tar.gz bin/check-config-${TRAVIS_TAG}.tar.gz bin/gen-config-${TRAVIS_TAG}.tar.gz +.PHONY: gh-release +gh-release: bin/server-${GH_TAG}.tar.gz bin/check-config-${GH_TAG}.tar.gz bin/gen-config-${GH_TAG}.tar.gz # Pre-push code testing .PHONY: git-push @@ -46,14 +46,14 @@ bin/check-config: $(FILES) bin/gen-config: $(FILES) $(call go_build,gen-config) -bin/server-${TRAVIS_TAG}.tar.gz: bin/server bin/static-content/index.html - @cd bin && tar -czf server-${TRAVIS_TAG}.tar.gz server static-content && cd .. +bin/server-${GH_TAG}.tar.gz: bin/server bin/static-content/index.html + @cd bin && tar -czf server-${GH_TAG}.tar.gz server static-content && rm server && rm -rf static-content && cd .. -bin/gen-config-${TRAVIS_TAG}.tar.gz: bin/gen-config - @cd bin && tar -czf gen-config-${TRAVIS_TAG}.tar.gz gen-config && cd .. +bin/gen-config-${GH_TAG}.tar.gz: bin/gen-config + @cd bin && tar -czf gen-config-${GH_TAG}.tar.gz gen-config && rm gen-config && cd .. -bin/check-config-${TRAVIS_TAG}.tar.gz: bin/check-config - @cd bin && tar -czf check-config-${TRAVIS_TAG}.tar.gz check-config && cd .. +bin/check-config-${GH_TAG}.tar.gz: bin/check-config + @cd bin && tar -czf check-config-${GH_TAG}.tar.gz check-config && rm check-config && cd .. bin/static-content/index.html: docs/api.html @mkdir -p bin/static-content