Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert gocardless/stolon to Github Actions #66

Open
wants to merge 16 commits into
base: gocardless-v0.17.0+
Choose a base branch
from
51 changes: 51 additions & 0 deletions .github/workflows/build-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: gocardless/stolon/build-integration
on:
push:
branches:
- gocardless-v0.17.0+
env:
GITHUB_TOKEN: xxxx6d08
jobs:
unit-tests:
defaults:
run:
working-directory: "/go/src/github.com/sorintlab/stolon"
runs-on: ubuntu-latest
container:
image: golang:1.16
steps:
- uses: actions/checkout@v2
- name: Unit tests
run: make test
release:
if: contains('refs/heads/gocardless-v0.17.0+', github.ref)
defaults:
run:
working-directory: "/go/src/github.com/sorintlab/stolon"
runs-on: ubuntu-latest
container:
image: golang:1.16
needs:
- unit-tests
steps:
- uses: actions/checkout@v2
# Ensure parameter if_key_exists is set correctly
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: "${{ secrets.CIRCLE_CI_SSH_KEY }}"
name: circle_ci_id_rsa
known_hosts: "${{ secrets.CIRCLE_CI_KNOWN_HOSTS }}"
if_key_exists: fail
- name: Release
run: |-
CURRENT_VERSION="v$(cat VERSION)"
if [[ $(git tag -l "${CURRENT_VERSION}") == "${CURRENT_VERSION}" ]]; then
echo "Version ${CURRENT_VERSION} is already released"
exit 0
fi
curl -L -o /tmp/goreleaser_Linux_x86_64.tar.gz https://github.com/goreleaser/goreleaser/releases/download/v1.7.0/goreleaser_Linux_x86_64.tar.gz
tar zxf /tmp/goreleaser_Linux_x86_64.tar.gz -C /tmp
git tag "${CURRENT_VERSION}"
git push --tags
/tmp/goreleaser --rm-dist
sam-robson marked this conversation as resolved.
Show resolved Hide resolved