Skip to content

Commit

Permalink
Go auto release workflows (#67)
Browse files Browse the repository at this point in the history
* Update workflows to go-auto-release

* Update workflows to go-auto-release

* Update workflows to go-auto-release

* Update workflows to go-auto-release

* Update workflows to go-auto-release
  • Loading branch information
goruha authored Apr 23, 2024
1 parent 11e5705 commit c441d59
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 203 deletions.
54 changes: 0 additions & 54 deletions .github/auto-release.yml

This file was deleted.

15 changes: 0 additions & 15 deletions .github/workflows/auto-release.yml

This file was deleted.

82 changes: 11 additions & 71 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,75 +1,15 @@
# This GitHub action publish assets for release when a tag is created.
name: release
name: Release
on:
push:
tags:
- "*"
release:
types: [published]

workflow_dispatch:
permissions: {}

jobs:
goreleaser:
runs-on: "self-hosted-large"
steps:
- name: Install Git & GPG
run: |-
sudo apt-get update && sudo apt-get install -y git gnupg2
- name: Checkout
uses: actions/checkout@v3

- name: Unshallow
run: |-
git fetch --prune --unshallow
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: "1.20"

- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v5
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PRIVATE_KEY_PASSPHRASE }}
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: false

- name: Check disk space before
shell: bash
run: |-
printf "\nPWD is %s\ndf -h %s\n\n" "$(pwd -P)" "$(pwd -P)"
df -h $(pwd -P)
if [[ -n $TMPDIR ]]; then
printf "\n\nTMPDIR set to %s\ndf -h %s\n\n" "$TMPDIR" "$TMPDIR"
df -h "$TMPDIR"
else
printf "\n\nTMPDIR not set, showing space in /tmp\n\n"
df -h /tmp
fi
printf "\n\nAll disk space:\n"
df -h
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
version: latest
args: release --clean --parallelism 2 --timeout 180m
env:
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Check disk space after
if: success() || failure()
shell: bash
run: |-
printf "\nPWD is %s\ndf -h %s\n\n" "$(pwd -P)" "$(pwd -P)"
df -h $(pwd -P)
if [[ -n $TMPDIR ]]; then
printf "\n\nTMPDIR set to %s\ndf -h %s\n\n" "$TMPDIR" "$TMPDIR"
df -h "$TMPDIR"
else
printf "\n\nTMPDIR not set, showing space in /tmp\n\n"
df -h /tmp
fi
printf "\n\nAll disk space:\n"
df -h
jobs:
perform:
uses: cloudposse/.github/.github/workflows/shared-release-branches.yml@main
secrets: inherit
49 changes: 34 additions & 15 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,37 @@ on:
types: [opened, synchronize, reopened]
paths-ignore:
- "README.md"
release:
types: [created]

push:
branches:
- main
- release/v*
paths-ignore:
- "README.md"
- '.github/**'
- 'docs/**'
- 'examples/**'
- 'test/**'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false

jobs:
# ensure the code builds...
build:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Set up Go
uses: actions/setup-go@v2.1.3
- name: Check out code into the Go module directory
uses: actions/checkout@v4

- name: 'Setup Go'
uses: actions/setup-go@v5
with:
go-version: "1.20"
go-version-file: go.mod
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v2.3.3

- name: Get dependencies
run: |
go mod download
Expand Down Expand Up @@ -53,15 +64,15 @@ jobs:
- "1.4.0"
- "1.5.0"
steps:
- name: Set up Go
uses: actions/setup-go@v2.1.3
- name: Check out code into the Go module directory
uses: actions/checkout@v4

- name: 'Setup Go'
uses: actions/setup-go@v5
with:
go-version: "1.20"
go-version-file: go.mod
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v2.3.3

- name: Get dependencies
run: |
make deps
Expand All @@ -73,3 +84,11 @@ jobs:
TF_ACC_TERRAFORM_VERSION: ${{ matrix.terraform }}
run: |
make testacc
release:
needs: test
if: github.event_name == 'push'
uses: cloudposse/.github/.github/workflows/shared-go-auto-release.yml@main
with:
publish: true
secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/validate-codeowners.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: "Checkout source code at current commit"
uses: actions/checkout@v2
uses: actions/checkout@v4
- uses: mszostok/codeowners-validator@v0.7.1
if: github.event.pull_request.head.repo.full_name == github.repository
name: "Full check of CODEOWNERS"
Expand Down
47 changes: 0 additions & 47 deletions .goreleaser.yml

This file was deleted.

0 comments on commit c441d59

Please sign in to comment.