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

Commit

Permalink
Merge pull request #28 from aserto-dev/179888370/add_cd
Browse files Browse the repository at this point in the history
Add cd for Aserto IDP
  • Loading branch information
gimmyxd committed Nov 4, 2021
2 parents 432d107 + 26f25d0 commit 871f741
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 1 deletion.
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

0 comments on commit 871f741

Please sign in to comment.