Skip to content

Commit

Permalink
Improve the release workflow (#4171)
Browse files Browse the repository at this point in the history
Improve the release workflow by splitting release creation from binaries
and docker image build and upload and parallelizing binary building,
docker image creation and packages building.
  • Loading branch information
sblaisot committed Oct 17, 2023
2 parents 3c78a74 + 32fafa6 commit d2547a4
Showing 1 changed file with 25 additions and 5 deletions.
30 changes: 25 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,18 @@ on:
tags:
- "*.*.*" # Matching a version number like 1.4.19
jobs:
publish_on_release:
create_release:
runs-on: ubuntu-22.04
steps:
- name: Create the release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
tag_name="${GITHUB_REF##*/}"
gh release create "$tag_name" --target "$GITHUB_SHA"
publish_binaries:
runs-on: ubuntu-22.04
needs: create_release
steps:
- name: Install Go
uses: actions/setup-go@v4
Expand All @@ -18,20 +28,30 @@ jobs:
GOOS=linux GOARCH=amd64 ./scripts/build.sh release
GOOS=linux GOARCH=arm ./scripts/build.sh release
GOOS=freebsd GOARCH=amd64 ./scripts/build.sh release
- name: Create the release
- name: Upload binaries to release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
tag_name="${GITHUB_REF##*/}"
gh release create "$tag_name" cozy-stack-* --target "$GITHUB_SHA"
gh release upload "$tag_name" cozy-stack-*
publish_cozy-app-dev_image:
runs-on: ubuntu-22.04
needs: create_release
steps:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: "1.21.x"
- name: Checkout code
uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_SECRET }}
- name: Build and publish the cozy-app-dev image
run: scripts/release.sh
build_deb_packages:
publish_deb_packages:
strategy:
matrix:
os:
Expand All @@ -43,7 +63,7 @@ jobs:
"ubuntu:22.04",
]
runs-on: ubuntu-latest
needs: publish_on_release
needs: create_release
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down

0 comments on commit d2547a4

Please sign in to comment.