Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Add cd for Aserto IDP #28

Merged
merged 1 commit into from
Nov 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 55 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
push:
branches:
- main
# Publish `v1.2.3` tags as releases.
tags:
- v*
# Run tests for PRs
pull_request:
branches:
Expand Down Expand Up @@ -66,4 +69,55 @@ jobs:
uses: shogo82148/actions-goveralls@v1
continue-on-error: true
with:
path-to-profile: cover.out
path-to-profile: cover.out

release:
needs: test
runs-on: ubuntu-latest
# Only release when ref is a tag
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
steps:
- name: Read Configuration
uses: hashicorp/vault-action@v2.1.0
id: vault
with:
url: ${{ env.VAULT_ADDR }}
token: ${{ secrets.VAULT_TOKEN }}
secrets: |
kv/data/github "SSH_PRIVATE_KEY" | SSH_PRIVATE_KEY;
kv/data/github "READ_WRITE_TOKEN" | READ_WRITE_TOKEN;
- name: Install Vault CLI
uses: innovationnorway/setup-vault@v1.0.3
with:
version: 1.4.2
- name: Renew Vault Token
env:
VAULT_TOKEN: ${{ secrets.VAULT_TOKEN }}
run: |
vault token renew
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- name: Setup caching
uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Release
env:
GITHUB_TOKEN: ${{ steps.vault.outputs.READ_WRITE_TOKEN }}
run: |
mkdir -p $HOME/.ssh
umask 0077 && echo -e "${SSH_PRIVATE_KEY}" > $HOME/.ssh/id_rsa
ssh-keyscan github.com >> $HOME/.ssh/known_hosts
git config --global url."git@github.com:".insteadOf https://github.com/
git config --global user.email "github-bot@aserto.com"
git config --global user.name "Aserto Bot"

go run mage.go deps release
5 changes: 5 additions & 0 deletions magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ func Clean() error {
return os.RemoveAll("dist")
}

// Release releases the project.
func Release() error {
return common.Release()
}

// BuildAll builds all binaries in ./cmd for
// all configured operating systems and architectures.
func BuildAll() error {
Expand Down