diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..5afa25fae --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,39 @@ +name: Release + +on: + create: + tags: + - v*.*.* + +jobs: + + build: + name: Build + runs-on: ubuntu-latest + steps: + + - name: Check out code into the Go module directory + uses: actions/checkout@v1 + + - name: Print version info + id: semver + run: | + make version + + - name: Set up Docker Buildx + id: buildx + uses: crazy-max/ghaction-docker-buildx@master + with: + version: latest + + - name: Available platforms + run: echo ${{ steps.buildx.outputs.platforms }} + + - name: Build + env: + DOCKER_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} + USERNAME: 1gtm + APPSCODE_ENV: prod + run: | + docker login --username ${USERNAME} --password ${DOCKER_TOKEN} + make release diff --git a/Makefile b/Makefile index 7c7c27dcc..0dd614279 100644 --- a/Makefile +++ b/Makefile @@ -125,12 +125,12 @@ all-container: $(addprefix container-, $(subst /,_, $(DOCKER_PLATFORMS))) all-push: $(addprefix push-, $(subst /,_, $(DOCKER_PLATFORMS))) version: - @echo version=$(VERSION) - @echo version_strategy=$(version_strategy) - @echo git_tag=$(git_tag) - @echo git_branch=$(git_branch) - @echo commit_hash=$(commit_hash) - @echo commit_timestamp=$(commit_timestamp) + @echo ::set-output name=version::$(VERSION) + @echo ::set-output name=version_strategy::$(version_strategy) + @echo ::set-output name=git_tag::$(git_tag) + @echo ::set-output name=git_branch::$(git_branch) + @echo ::set-output name=commit_hash::$(commit_hash) + @echo ::set-output name=commit_timestamp::$(commit_timestamp) DOCKER_REPO_ROOT := /go/src/$(GO_PKG)/$(REPO)