-
Notifications
You must be signed in to change notification settings - Fork 141
88 lines (88 loc) · 2.61 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: Create releases
on:
push:
tags:
- "*.*.*" # Matching a version number like 1.4.19
jobs:
create_release:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- 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
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: Upload binaries to release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
tag_name="${GITHUB_REF##*/}"
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
publish_deb_packages:
strategy:
matrix:
os:
[
"debian:10",
"debian:11",
"debian:12",
"ubuntu:20.04",
"ubuntu:22.04",
]
runs-on: ubuntu-latest
needs: create_release
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build package
uses: addnab/docker-run-action@v3
with:
image: ${{ matrix.os }}
options: -v ${{ github.workspace }}:/build -e GOVERSION=1.21.3
run: |
echo "[safe]" > /root/.gitconfig
echo " directory = /build" >> /root/.gitconfig
cd /build
scripts/packaging/installrequirements.sh
scripts/packaging/buildpackage.sh
- name: Upload package to release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
tag_name="${GITHUB_REF##*/}"
gh release upload "$tag_name" packages/*.deb