Skip to content

Commit

Permalink
Begin porting travis workflows (#25)
Browse files Browse the repository at this point in the history
* Begin porting travis workflows

* Fix github target name

* Fix github-release target name

* Only publish tarred files in release

* Removed travis config
  • Loading branch information
dmgaldi authored Apr 27, 2022
1 parent a709e3c commit ba2fb1a
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 32 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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 }}
24 changes: 0 additions & 24 deletions .travis.yml

This file was deleted.

16 changes: 8 additions & 8 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit ba2fb1a

Please sign in to comment.