-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: deb, rpm, and homebrew support (#28)
* Adds support for deb, rpm, and Homebrew installation
- Loading branch information
Showing
15 changed files
with
2,153 additions
and
465 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,150 +1,45 @@ | ||
name: hinge Release | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
release: | ||
name: Create Release | ||
runs-on: ubuntu-latest | ||
outputs: | ||
upload_url: ${{ steps.upload_url.outputs.upload_url }} | ||
|
||
steps: | ||
- name: Checkout code | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: Release ${{ github.ref }} | ||
body: | | ||
This release has the following changes: | ||
- README Updates. | ||
draft: false | ||
prerelease: false | ||
|
||
- name: Fix Upload URL | ||
id: upload_url | ||
run: echo ::set-output name=upload_url::$(echo "${{ steps.create_release.outputs.upload_url }}" | cut -d"{" -f1) | ||
|
||
- name: Echo upload url | ||
run: echo "${{ steps.upload_url.outputs.upload_url }}" | ||
|
||
build: | ||
needs: release | ||
strategy: | ||
matrix: | ||
os: ["darwin", "freebsd", "linux", "netbsd", "openbsd", "windows"] | ||
arch: ["amd64", "arm64", "arm"] | ||
|
||
env: | ||
UPLOAD_URL: ${{ needs.release.outputs.upload_url }} | ||
|
||
name: Build and Upload Assets | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Go | ||
fetch-depth: 0 | ||
- | ||
name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: '1.18' | ||
|
||
- name: Get the version | ||
id: get_version | ||
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\/v/} | ||
|
||
- name: Generate SBOM | ||
uses: CycloneDX/gh-gomod-generate-sbom@v0.3.0 | ||
go-version: 1.18 | ||
- | ||
name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v2 | ||
with: | ||
include-stdlib: true | ||
json: true | ||
output: sbom.json | ||
resolve-licenses: true | ||
version: "^v0" | ||
|
||
- name: Build amd64 Assets | ||
if: matrix.arch == 'amd64' | ||
run: | | ||
echo "${{ matrix.os }} ${{ matrix.arch }}" | ||
env GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} go build -o $FILE github.com/devops-kung-fu/hinge | ||
env: | ||
FILE: build/hinge-${{ steps.get_version.outputs.VERSION }}-${{ matrix.os }}-${{ matrix.arch }} | ||
|
||
- name: Build arm64 Assets | ||
if: matrix.arch == 'arm64' && matrix.os == 'linux' | ||
run: | | ||
echo "${{ matrix.os }} ${{ matrix.arch }}" | ||
env GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} go build -o $FILE github.com/devops-kung-fu/hinge | ||
env: | ||
FILE: build/hinge-${{ steps.get_version.outputs.VERSION }}-${{ matrix.os }}-${{ matrix.arch }} | ||
|
||
- name: Build arm Assets | ||
if: matrix.arch == 'arm' && (matrix.os == 'freebsd' || matrix.os == 'netbsd' || matrix.os == 'openbsd') | ||
run: | | ||
echo "${{ matrix.os }} ${{ matrix.arch }}" | ||
env GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} go build -o $FILE github.com/devops-kung-fu/hinge | ||
env: | ||
FILE: build/hinge-${{ steps.get_version.outputs.VERSION }}-${{ matrix.os }}-${{ matrix.arch }} | ||
|
||
- name: Upload SBoM | ||
run: | | ||
curl \ | ||
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ | ||
-H "Content-Type: $(file -b --mime-type $FILE)" \ | ||
--data-binary @$FILE \ | ||
"$UPLOAD_URL?name=$(basename $FILE)" | ||
env: | ||
FILE: sbom.json | ||
|
||
- name: Upload amd64 Non-Windows | ||
if: matrix.os != 'windows' && matrix.arch == 'amd64' | ||
run: | | ||
curl \ | ||
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ | ||
-H "Content-Type: $(file -b --mime-type $FILE)" \ | ||
--data-binary @$FILE \ | ||
"$UPLOAD_URL?name=$(basename $FILE)" | ||
env: | ||
FILE: build/hinge-${{ steps.get_version.outputs.VERSION }}-${{ matrix.os }}-${{ matrix.arch }} | ||
|
||
- name: Upload amd64 Windows | ||
if: matrix.os == 'windows' && matrix.arch == 'amd64' | ||
run: | | ||
curl \ | ||
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ | ||
-H "Content-Type: $(file -b --mime-type $FILE)" \ | ||
--data-binary @$FILE \ | ||
"$UPLOAD_URL?name=$(basename $FILE)" | ||
env: | ||
FILE: build/hinge-${{ steps.get_version.outputs.VERSION }}-${{ matrix.os }}-${{ matrix.arch }}.exe | ||
|
||
- name: Upload arm64 | ||
if: matrix.os == 'linux' && matrix.arch == 'arm64' | ||
run: | | ||
curl \ | ||
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ | ||
-H "Content-Type: $(file -b --mime-type $FILE)" \ | ||
--data-binary @$FILE \ | ||
"$UPLOAD_URL?name=$(basename $FILE)" | ||
env: | ||
FILE: build/hinge-${{ steps.get_version.outputs.VERSION }}-${{ matrix.os }}-${{ matrix.arch }} | ||
distribution: goreleaser | ||
version: ${{ env.GITHUB_REF_NAME }} | ||
args: release --rm-dist | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.PUBLISHER_TOKEN }} | ||
- | ||
name: Generate SBOM | ||
uses: anchore/sbom-action@v0 | ||
with: | ||
artifact-name: hinge.spdx.json | ||
path: . | ||
- | ||
name: Release SBOM | ||
uses: anchore/sbom-action/publish-sbom@v0 | ||
with: | ||
sbom-artifact-match: ".*\\.spdx.json$" | ||
|
||
- name: Upload arm | ||
if: (matrix.os == 'freebsd' || matrix.os == 'netbsd' || matrix.os == 'openbsd') && matrix.arch == 'arm' | ||
run: | | ||
curl \ | ||
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ | ||
-H "Content-Type: $(file -b --mime-type $FILE)" \ | ||
--data-binary @$FILE \ | ||
"$UPLOAD_URL?name=$(basename $FILE)" | ||
env: | ||
FILE: build/hinge-${{ steps.get_version.outputs.VERSION }}-${{ matrix.os }}-${{ matrix.arch }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,4 +15,5 @@ | |
# vendor/ | ||
|
||
.DS_Store | ||
|
||
hinge |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
project_name: hinge | ||
|
||
builds: | ||
- | ||
binary: hinge | ||
goos: | ||
- darwin | ||
- linux | ||
goarch: | ||
- amd64 | ||
- arm64 | ||
|
||
release: | ||
prerelease: auto | ||
|
||
universal_binaries: | ||
- replace: true | ||
|
||
brews: | ||
- | ||
name: hinge | ||
homepage: "https://github.com/devops-kung-fu/hinge" | ||
tap: | ||
owner: devops-kung-fu | ||
name: homebrew-tap | ||
commit_author: | ||
name: djschleen | ||
email: djschleen@gmail.com | ||
|
||
checksum: | ||
name_template: 'checksums.txt' | ||
|
||
nfpms: | ||
- maintainer: DJ Schleen <djschleen@gmail.com> | ||
description: Creates and updates your Dependabot config. | ||
homepage: https://github.com/devops-kung-fu/hinge | ||
license: MPL | ||
formats: | ||
- deb | ||
- rpm | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.