Skip to content

Commit

Permalink
clean
Browse files Browse the repository at this point in the history
  • Loading branch information
dunglas committed Jul 18, 2023
1 parent 97c0c6f commit 41430ed
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
17 changes: 15 additions & 2 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ on:
tags:
- 'v*'
branches:
- ci/goreleaser-replacements
- '*'
pull_request:

permissions:
contents: write

jobs:
release:
Expand All @@ -15,31 +19,40 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'
cache-dependency-path: |
go.sum
caddy/go.sum
- name: Login to Docker Hub
if: startsWith(github.ref, 'refs/tags/v')
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v5
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.PASSPHRASE }}

- name: Set GoReleaser Git tags
run:
tags=$(git tag --list --sort=-version:refname 'v*')
echo "GORELEASER_CURRENT_TAG=$(awk 'NR==1 {print;exit}' <<< $tags)" >> "$GITHUB_ENV"
echo "GORELEASER_PREVIOUS_TAG=$(awk 'NR==2 {print;exit}' <<< $tags)" >> "$GITHUB_ENV"

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
version: latest
args: release --clean --snapshot
args: release --clean ${{startsWith(github.ref, 'refs/tags/v') && '' || '--snapshot'}}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
4 changes: 2 additions & 2 deletions .github/workflows/ci-chart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
python-version: '3.10'

- name: Set up chart-testing
uses: helm/chart-testing-action@v2.4.0
uses: helm/chart-testing-action@v2

- name: Run chart-testing (list-changed)
id: list-changed
Expand All @@ -39,7 +39,7 @@ jobs:

- name: Create kind cluster
if: steps.list-changed.outputs.changed == 'true'
uses: helm/kind-action@v1.5.0
uses: helm/kind-action@v1

- name: Run chart-testing (install)
if: steps.list-changed.outputs.changed == 'true'
Expand Down

0 comments on commit 41430ed

Please sign in to comment.