Skip to content

Commit

Permalink
Merge pull request #8 from fortio/common_setup
Browse files Browse the repository at this point in the history
Common setup
  • Loading branch information
ldemailly authored Mar 22, 2024
2 parents 4683acc + eba68c4 commit 273d4fd
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 10 deletions.
23 changes: 23 additions & 0 deletions .github/actions/common_setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: 'Common Setup'
description: 'Common setup steps for build related workflows'
inputs: # Seems we can't use secrets in action.yml
DOCKER_USER:
description: 'Docker Hub username'
required: true
DOCKER_TOKEN:
description: 'Docker Hub password'
required: true
runs:
using: 'composite'
steps:
- name: Checkout
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # pin@v3
with:
fetch-depth: 0
- uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # pin@v1
- uses: docker/setup-buildx-action@2b51285047da1547ffb1b2203d8be4c0af6b1f20 # pin@v1
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ inputs.DOCKER_USER }}
password: ${{ inputs.DOCKER_TOKEN }}
16 changes: 6 additions & 10 deletions .github/workflows/releaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ on:
# so a vX.Y.Z-test1 doesn't trigger build
- 'v[0-9]+.[0-9]+.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-pre*'
# pull_request: # To test
# branches: [ main ]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
Expand All @@ -28,22 +30,16 @@ jobs:
# The type of runner that the job will run on
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # pin@v3
- name: Common Setup
uses: fortio/workflows/.github/actions/common_setup@main
with:
fetch-depth: 0
- uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # pin@v1
- uses: docker/setup-buildx-action@2b51285047da1547ffb1b2203d8be4c0af6b1f20 # pin@v1
DOCKER_USER: ${{ secrets.DOCKER_USER }}
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
- name: Set up Go
uses: actions/setup-go@v5 # pin@v3
with:
go-version: '1.21'
check-latest: true
- name: Log in to Docker Hub
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # pin@v2
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Download goreleaser config
run: curl -fsS -o .goreleaser.yaml https://raw.githubusercontent.com/fortio/workflows/main/goreleaser.yaml
- name: "GoReleaser Action"
Expand Down

0 comments on commit 273d4fd

Please sign in to comment.