-
Notifications
You must be signed in to change notification settings - Fork 880
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #841
- Loading branch information
Showing
3 changed files
with
57 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*" | ||
|
||
jobs: | ||
tagged-release: | ||
name: "Tagged Release" | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Install dependencies | ||
run: sudo apt-get update && sudo apt-get install git ruby rpm -y | ||
- name: Install fpm | ||
run: gem install fpm || sudo gem install fpm | ||
- name: Set up Go 1.15 | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.15 | ||
id: go | ||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v2 | ||
- name: Make release directory | ||
run: mkdir dist | ||
- name: Build deb and rpm | ||
run: make deb-pkg rpm-pkg | ||
- name: Move deb and rpm into release directory | ||
run: mv *.deb *.rpm dist/ | ||
- name: Set RELEASE_VERSION | ||
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | ||
- name: Build darwin binary | ||
run: GOOS=darwin CGO_ENABLED=0 go build -mod vendor -o dist/sops-${{ env.RELEASE_VERSION }}.darwin go.mozilla.org/sops/v3/cmd/sops | ||
- name: Build windows binary | ||
run: GOOS=windows CGO_ENABLED=0 go build -mod vendor -o dist/sops-${{ env.RELEASE_VERSION }}.exe go.mozilla.org/sops/v3/cmd/sops | ||
- name: Copy already built linux binary | ||
run: cp tmppkg/usr/local/bin/sops dist/sops-${{ env.RELEASE_VERSION }}.linux | ||
- name: Create release | ||
uses: "marvinpinto/action-automatic-releases@latest" | ||
with: | ||
repo_token: "${{ secrets.GITHUB_TOKEN }}" | ||
prerelease: true | ||
files: | | ||
dist/sops-${{ env.RELEASE_VERSION }}.windows | ||
dist/sops-${{ env.RELEASE_VERSION }}.darwin | ||
dist/sops-${{ env.RELEASE_VERSION }}.linux | ||
dist/sops_${{ env.RELEASE_VERSION }}_amd64.deb | ||
dist/sops_${{ env.RELEASE_VERSION }}-1.x86_64.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM golang:1.14 | ||
FROM golang:1.15 | ||
|
||
COPY . /go/src/go.mozilla.org/sops | ||
WORKDIR /go/src/go.mozilla.org/sops | ||
|
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 |
---|---|---|
|
@@ -48,27 +48,28 @@ functional-tests-all: | |
$(GO) build -o functional-tests/sops go.mozilla.org/sops/v3/cmd/sops | ||
cd functional-tests && cargo test && cargo test -- --ignored | ||
|
||
deb-pkg: install | ||
deb-pkg: vendor | ||
rm -rf tmppkg | ||
mkdir -p tmppkg/usr/local/bin | ||
cp $$GOPATH/bin/sops tmppkg/usr/local/bin/ | ||
GOOS=linux CGO_ENABLED=0 go build -mod vendor -o tmppkg/usr/local/bin/sops go.mozilla.org/sops/v3/cmd/sops | ||
fpm -C tmppkg -n sops --license MPL2.0 --vendor mozilla \ | ||
--description "Sops is an editor of encrypted files that supports YAML, JSON and BINARY formats and encrypts with AWS KMS and PGP." \ | ||
-m "Julien Vehent <jvehent[email protected]>" \ | ||
-m "AJ Bahnken <ajvb[email protected]>" \ | ||
--url https://go.mozilla.org/sops \ | ||
--architecture x86_64 \ | ||
-v "$$(grep '^const Version' version/version.go |cut -d \" -f 2)" \ | ||
-s dir -t deb . | ||
|
||
rpm-pkg: install | ||
rpm-pkg: vendor | ||
rm -rf tmppkg | ||
mkdir -p tmppkg/usr/local/bin | ||
cp $$GOPATH/bin/sops tmppkg/usr/local/bin/ | ||
GOOS=linux CGO_ENABLED=0 go build -mod vendor -o tmppkg/usr/local/bin/sops go.mozilla.org/sops/v3/cmd/sops | ||
fpm -C tmppkg -n sops --license MPL2.0 --vendor mozilla \ | ||
--description "Sops is an editor of encrypted files that supports YAML, JSON and BINARY formats and encrypts with AWS KMS and PGP." \ | ||
-m "Julien Vehent <jvehent[email protected]>" \ | ||
-m "AJ Bahnken <ajvb[email protected]>" \ | ||
--url https://go.mozilla.org/sops \ | ||
--architecture x86_64 \ | ||
--rpm-os linux \ | ||
-v "$$(grep '^const Version' version/version.go |cut -d \" -f 2)" \ | ||
-s dir -t rpm . | ||
|
||
|