Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the release workflow #4171

Merged
merged 1 commit into from
Oct 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading