Skip to content

Commit

Permalink
Merge pull request hashicorp#102 from hashicorp/release-publish-to-re…
Browse files Browse the repository at this point in the history
…leases

build: Publish artifacts to releases.hashicorp.com
  • Loading branch information
radeksimko authored May 19, 2020
2 parents db9a7e6 + ffc08b3 commit 221ee12
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,19 @@ jobs:
id: codesign
env:
VERSION: v0
-
name: Install hc-releases
run: |
DOWNLOAD_URL=$(curl -SsL \
-H "Authorization: token ${{ secrets.CODESIGN_GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/hashicorp/hc-releases/releases/latest \
| jq -r '.assets[] | select(.name | contains("linux_amd64.tgz")) | .url')
curl -SsL -o /tmp/hc-releases.tgz \
-H "Authorization: token ${{ secrets.CODESIGN_GITHUB_TOKEN }}" \
-H "Accept: application/octet-stream" ${DOWNLOAD_URL}
tar xzf /tmp/hc-releases.tgz
sudo mv hc-releases /usr/bin/hc-releases
-
name: Import PGP key for archive signing
run: echo -e "${{ secrets.PGP_SIGNING_KEY }}" | gpg --import
Expand All @@ -40,8 +53,16 @@ jobs:
args: release
env:
PGP_USER_ID: ${{ secrets.PGP_USER_ID }}
RELEASE_AWS_ACCESS_KEY_ID: ${{ secrets.RELEASE_AWS_ACCESS_KEY_ID }}
RELEASE_AWS_SECRET_ACCESS_KEY: ${{ secrets.RELEASE_AWS_SECRET_ACCESS_KEY }}
CODESIGN_IMAGE: ${{ steps.codesign.outputs.image }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ARTIFACTORY_TOKEN: ${{ secrets.ARTIFACTORY_TOKEN }}
ARTIFACTORY_USER: ${{ secrets.ARTIFACTORY_USER }}
CIRCLE_TOKEN: ${{ secrets.CIRCLE_TOKEN }}
-
name: Publish released artifacts
run: hc-releases publish
env:
AWS_ACCESS_KEY_ID: ${{ secrets.RELEASE_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.RELEASE_AWS_SECRET_ACCESS_KEY }}
9 changes: 9 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,14 @@ signs:
args: ["-u", "{{ .Env.PGP_USER_ID }}", "--output", "${signature}", "--detach-sign", "${artifact}"]
artifacts: checksum

publishers:
- name: "hc-releases"
checksum: true
signature: true
cmd: hc-releases upload-file {{ abs .ArtifactPath }}
env:
- AWS_ACCESS_KEY_ID={{ .Env.RELEASE_AWS_ACCESS_KEY_ID }}
- AWS_SECRET_ACCESS_KEY={{ .Env.RELEASE_AWS_SECRET_ACCESS_KEY }}

changelog:
skip: true

0 comments on commit 221ee12

Please sign in to comment.