Skip to content

Commit

Permalink
chore: polishing valet ci output
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Robson committed Oct 27, 2022
1 parent fe6cfc3 commit e58fae8
Showing 1 changed file with 38 additions and 38 deletions.
76 changes: 38 additions & 38 deletions .github/workflows/build-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,50 +2,50 @@ name: gocardless/stolon/build-integration
on:
push:
branches:
- gocardless-v0.17.0+
env:
GITHUB_TOKEN: xxxx6d08
- gocardless-v0.17.0+
- convert-gocardless-stolon-to-actions-20221012-105611

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
- uses: actions/checkout@v3
- name: Unit tests
run: make test

need-release:
runs-on: ubuntu-latest
outputs:
release: ${{ steps.get_version.outputs.release }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
# Check our VERSION file against the one in git, to see if we need to release
- name: Get version
id: get_version
run: |
CURRENT_VERSION="v$(cat VERSION)"
if [[ $(git tag -l "${CURRENT_VERSION}") == "${CURRENT_VERSION}" ]]; then
echo "Version ${CURRENT_VERSION} is already released"
echo ::set-output name=release::false
else
echo "Version ${CURRENT_VERSION} can be released"
echo ::set-output name=release::true
fi
release:
if: contains('refs/heads/gocardless-v0.17.0+', github.ref)
defaults:
run:
working-directory: "/go/src/github.com/sorintlab/stolon"
needs: need-release
if: ${{ needs.need-release.outputs.release == 'true' }}
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
- uses: actions/[email protected]
- name: Release
run: |
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 "v$(cat VERSION)"
git push --tags
/tmp/goreleaser --rm-dist

0 comments on commit e58fae8

Please sign in to comment.