From 2c495a347f305e7f9034eadc8d0e2d3fafc19fa7 Mon Sep 17 00:00:00 2001 From: max furman Date: Thu, 18 Feb 2021 14:28:17 -0800 Subject: [PATCH] [actions] renaming jobs and setting up docker job --- .github/workflows/release.yml | 52 ++++++++++++------------- .goreleaser.yml | 72 +++++++++++++++++------------------ Makefile | 32 +--------------- 3 files changed, 64 insertions(+), 92 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 369f9122..0250e346 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,7 +7,7 @@ on: - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 jobs: - lint_test_build: + test: name: Lint, Test, Build runs-on: ubuntu-latest outputs: @@ -27,7 +27,7 @@ jobs: run: sudo apt-get -y install libpcsclite-dev - name: Lint, Test, Build - id: lintTestBuild + id: lint_test_build run: V=1 make -j1 bootstrap travis - name: Is Pre-release @@ -39,10 +39,10 @@ jobs: if [ $OUT -eq 0 ]; then IS_PRERELEASE=true; else IS_PRERELEASE=false; fi echo "::set-output name=IS_PRERELEASE::${IS_PRERELEASE}" - build_upload_github_assets: - name: Build & Upload Mac OS | Linux | Windows Assets To Github Release + release: + name: Create Release & Upload Assets runs-on: ubuntu-latest - needs: lint_test_build + needs: test steps: - name: Checkout @@ -63,27 +63,27 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.PAT }} - # build_upload_docker: - # name: Build & Upload Docker Images - # runs-on: ubuntu-latest - # needs: create_release - # if: needs.create_release.outputs.is_prerelease == 'false' - # steps: - # - name: Checkout - # uses: actions/checkout@v2 - # - name: Setup Go - # uses: actions/setup-go@v2 - # with: - # go-version: '^1.15.6' - # - name: Build - # id: build - # run: | - # PATH=$PATH:/usr/local/go/bin:/home/admin/go/bin - # make docker-artifacts - # env: - # DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} - # DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} - # + build_upload_docker: + name: Build & Upload Docker Images + runs-on: ubuntu-latest + needs: release + if: needs.test.outputs.is_prerelease == 'false' + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup Go + uses: actions/setup-go@v2 + with: + go-version: '^1.15.6' + - name: Build + id: build + run: | + PATH=$PATH:/usr/local/go/bin:/home/admin/go/bin + make docker-artifacts + env: + DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} + DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} + # build_upload_aws_s3_binaries: # name: Build & Upload AWS S3 Binaries # runs-on: ubuntu-latest diff --git a/.goreleaser.yml b/.goreleaser.yml index c691fa7d..e4bf1b87 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -5,7 +5,6 @@ before: hooks: # You may remove this if you don't use go modules. - go mod download - # - go generate ./... builds: - id: step-ca @@ -24,7 +23,7 @@ builds: flags: - -trimpath main: ./cmd/step-ca/main.go - binary: bin/step + binary: bin/step-ca ldflags: - -w -X main.Version={{.Version}} -X main.BuildTime={{.Date}} - @@ -124,41 +123,42 @@ release: # - glob: ./path/to/file.txt # - glob: ./glob/**/to/**/file/**/* # - glob: ./glob/foo/to/bar/file/foobar/override_from_previous -scoop: - # Template for the url which is determined by the given Token (github or gitlab) - # Default for github is "https://github.com///releases/download/{{ .Tag }}/{{ .ArtifactName }}" - # Default for gitlab is "https://gitlab.com///uploads/{{ .ArtifactUploadHash }}/{{ .ArtifactName }}" - # Default for gitea is "https://gitea.com///releases/download/{{ .Tag }}/{{ .ArtifactName }}" - url_template: "http://github.com/smallstep/certificates/releases/download/{{ .Tag }}/{{ .ArtifactName }}" - # Repository to push the app manifest to. - bucket: - owner: smallstep - name: scoop-bucket - - # Git author used to commit to the repository. - # Defaults are shown. - commit_author: - name: goreleaserbot - email: goreleaser@smallstep.com - - # The project name and current git tag are used in the format string. - commit_msg_template: "Scoop update for {{ .ProjectName }} version {{ .Tag }}" - - # Your app's homepage. - # Default is empty. - homepage: "https://smallstep.com/docs/step-ca" - - # Skip uploads for prerelease. - skip_upload: auto - - # Your app's description. - # Default is empty. - description: "A private certificate authority (X.509 & SSH) & ACME server for secure automated certificate management, so you can use TLS everywhere & SSO for SSH." - - # Your app's license - # Default is empty. - license: "Apache-2.0" + #scoop: + # # Template for the url which is determined by the given Token (github or gitlab) + # # Default for github is "https://github.com///releases/download/{{ .Tag }}/{{ .ArtifactName }}" + # # Default for gitlab is "https://gitlab.com///uploads/{{ .ArtifactUploadHash }}/{{ .ArtifactName }}" + # # Default for gitea is "https://gitea.com///releases/download/{{ .Tag }}/{{ .ArtifactName }}" + # url_template: "http://github.com/smallstep/certificates/releases/download/{{ .Tag }}/{{ .ArtifactName }}" + # + # # Repository to push the app manifest to. + # bucket: + # owner: smallstep + # name: scoop-bucket + # + # # Git author used to commit to the repository. + # # Defaults are shown. + # commit_author: + # name: goreleaserbot + # email: goreleaser@smallstep.com + # + # # The project name and current git tag are used in the format string. + # commit_msg_template: "Scoop update for {{ .ProjectName }} version {{ .Tag }}" + # + # # Your app's homepage. + # # Default is empty. + # homepage: "https://smallstep.com/docs/step-ca" + # + # # Skip uploads for prerelease. + # skip_upload: auto + # + # # Your app's description. + # # Default is empty. + # description: "A private certificate authority (X.509 & SSH) & ACME server for secure automated certificate management, so you can use TLS everywhere & SSO for SSH." + # + # # Your app's license + # # Default is empty. + # license: "Apache-2.0" #dockers: # - dockerfile: docker/Dockerfile diff --git a/Makefile b/Makefile index c9b453e1..3d30cf23 100644 --- a/Makefile +++ b/Makefile @@ -266,39 +266,11 @@ bundle-darwin: binary-darwin .PHONY: binary-linux binary-darwin bundle-linux bundle-darwin -################################################# -# Targets for creating OS specific artifacts and archives -################################################# - -artifacts-linux-tag: bundle-linux debian - -artifacts-darwin-tag: bundle-darwin - -artifacts-archive-tag: - $Q mkdir -p $(RELEASE) - $Q git archive v$(VERSION) | gzip > $(RELEASE)/step-certificates_$(VERSION).tar.gz - -artifacts-tag: artifacts-linux-tag artifacts-darwin-tag artifacts-archive-tag - -.PHONY: artifacts-linux-tag artifacts-darwin-tag artifacts-archive-tag artifacts-tag - ################################################# # Targets for creating step artifacts ################################################# -# For all builds that are not tagged and not on the master branch -artifacts-branch: - -# For all builds that are not tagged -artifacts-master: - -# For all builds with a release-candidate (-rc) tag -artifacts-release-candidate: artifacts-tag - -# For all builds with a release tag -artifacts-release: artifacts-tag - # This command is called by travis directly *after* a successful build -artifacts: artifacts-$(PUSHTYPE) docker-$(PUSHTYPE) +docker-artifacts: docker-$(PUSHTYPE) -.PHONY: artifacts-master artifacts-release-candidate artifacts-release artifacts +.PHONY: docker-artifacts