-
Notifications
You must be signed in to change notification settings - Fork 40
89 lines (78 loc) · 2.83 KB
/
publish_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
89
name: Publish Stable Cycamore
on:
pull_request:
paths:
- '.github/workflows/publish_release.yml'
release:
types: [released]
jobs:
build-and-test-for-release:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
strategy:
fail-fast: false
matrix:
ubuntu_versions : [
20.04,
22.04,
]
pkg_mgr : [
apt,
conda
]
name: Build, Test, Publish
steps:
- name: Tag as ci-image-cache
run: |
echo "version_tag=ci-image-cache" >> "$GITHUB_ENV"
echo "stable_tag=ci-image-cache" >> "$GITHUB_ENV"
- name: Tag as stable
if: ${{ github.repository_owner == 'cyclus' && github.event_name == 'release' }}
run: |
echo "version_tag=${{ github.event.release.tag_name }}" >> "$GITHUB_ENV"
echo "stable_tag=stable" >> "$GITHUB_ENV"
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Checkout Cycamore
uses: actions/checkout@v4
- name: Build, Test, and Push Cycamore
uses: docker/build-push-action@v5
with:
cache-from: type=registry,ref=ghcr.io/cyclus/cycamore_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }}/cycamore:ci-layer-cache
file: docker/Dockerfile
target: cycamore
push: true
tags: |
ghcr.io/cyclus/cycamore_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }}/cycamore:${{ env.version_tag }}
ghcr.io/cyclus/cycamore_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }}/cycamore:${{ env.stable_tag }}
build-args: |
pkg_mgr=${{ matrix.pkg_mgr }}
ubuntu_version=${{ matrix.ubuntu_versions }}
cyclus_tag=stable
- name: Make Debian Package
if: matrix.pkg_mgr == 'apt' && matrix.ubuntu_versions == '22.04'
uses: docker/build-push-action@v5
with:
cache-from: type=registry,ref=ghcr.io/cyclus/cycamore_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }}/cycamore:ci-layer-cache
file: docker/Dockerfile
target: deb-package
outputs: type=local,dest=.
build-args: |
pkg_mgr=${{ matrix.pkg_mgr }}
ubuntu_version=${{ matrix.ubuntu_versions }}
cyclus_tag=stable
- name: Upload .deb to release
if: github.event_name == 'release' && matrix.pkg_mgr == 'apt' && matrix.ubuntu_versions == '22.04'
uses: alexellis/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
with:
asset_paths: '["cycamore*.deb"]'