Build deb packages in CI #41
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create releases | |
on: | |
push: | |
tags: | |
- "*.*.*" # Matching a version number like 1.4.19 | |
jobs: | |
publish_on_release: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Install Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: "1.21.x" | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Build the binaries | |
run: | | |
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 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
tag_name="${GITHUB_REF##*/}" | |
gh release create "$tag_name" cozy-stack-* --target "$GITHUB_SHA" | |
- 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: | |
strategy: | |
matrix: | |
os: [debian-10, debian-11, debian-12, ubuntu-20.04, ubuntu-22.04] | |
runs-on: ${{ matrix.os }} | |
needs: publish_on_release | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: build_package | |
run: | | |
scripts/packaging/buildpackage.sh | |
- name: Upload artifact to release | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
tag_name="${GITHUB_REF##*/}" | |
gh release upload "$tag_name" packages/*.deb |