Parcourir la source

[actions] renaming jobs and setting up docker job

max furman il y a 5 ans
Parent
commit
2c495a347f
3 fichiers modifiés avec 64 ajouts et 92 suppressions
  1. 26 26
      .github/workflows/release.yml
  2. 36 36
      .goreleaser.yml
  3. 2 30
      Makefile

+ 26 - 26
.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

+ 36 - 36
.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/<repo_owner>/<repo_name>/releases/download/{{ .Tag }}/{{ .ArtifactName }}"
-  # Default for gitlab is "https://gitlab.com/<repo_owner>/<repo_name>/uploads/{{ .ArtifactUploadHash }}/{{ .ArtifactName }}"
-  # Default for gitea is "https://gitea.com/<repo_owner>/<repo_name>/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/<repo_owner>/<repo_name>/releases/download/{{ .Tag }}/{{ .ArtifactName }}"
+  #  # Default for gitlab is "https://gitlab.com/<repo_owner>/<repo_name>/uploads/{{ .ArtifactUploadHash }}/{{ .ArtifactName }}"
+  #  # Default for gitea is "https://gitea.com/<repo_owner>/<repo_name>/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

+ 2 - 30
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