Version management update #23
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: Publish Stable Cyclus | |
on: | |
pull_request: | |
paths: | |
- '.github/workflows/publish_release.yml' | |
release: | |
types: [released] | |
jobs: | |
build-and-test-ubuntu-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: Publish Ubuntu Release | |
steps: | |
- name: Tag as ci-image-cache | |
run: | | |
echo "version_tag=ci-image-cache" >> "$GITHUB_ENV" | |
echo "stable_tag=ci-image-cache" >> "$GITHUB_ENV" | |
echo "core_version=999.999.999" >> "$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" | |
echo "core_version=${{ github.event.release.tag_name }}" >> "$GITHUB_ENV" | |
- name: Log in to the Container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Checkout Cyclus | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build, Test, and Push Cyclus | |
uses: docker/build-push-action@v5 | |
with: | |
cache-from: type=registry,ref=ghcr.io/cyclus/cyclus_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }}/cyclus:ci-layer-cache | |
file: docker/Dockerfile | |
push: true | |
target: cyclus | |
tags: | | |
ghcr.io/cyclus/cyclus_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }}/cyclus:${{ env.version_tag }} | |
ghcr.io/cyclus/cyclus_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }}/cyclus:${{ env.stable_tag }} | |
build-args: | | |
pkg_mgr=${{ matrix.pkg_mgr }} | |
ubuntu_version=${{ matrix.ubuntu_versions }} | |
- 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/cyclus_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }}/cyclus: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 }} | |
core_version=${{ env.core_version }} | |
- name: Upload .deb to release | |
if: github.event_name == 'release' && matrix.pkg_mgr == 'apt' && matrix.ubuntu_versions == '22.04' | |
uses: alexellis/upload-assets@0.4.0 | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
with: | |
asset_paths: '["cyclus*.deb"]' | |
build-and-test-rocky-release: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
strategy: | |
fail-fast: false | |
matrix: | |
rocky_versions : [ | |
8, | |
9, | |
] | |
name: Publish Rocky Release | |
steps: | |
- name: Tag as ci-image-cache | |
run: | | |
echo "version_tag=ci-image-cache" >> "$GITHUB_ENV" | |
echo "stable_tag=ci-image-cache" >> "$GITHUB_ENV" | |
echo "core_version=999.999.999" >> "$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" | |
echo "core_version=${{ github.event.release.tag_name }}" >> "$GITHUB_ENV" | |
- name: Log in to the Container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Checkout Cyclus | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build, Test, and Push Cyclus | |
uses: docker/build-push-action@v5 | |
with: | |
cache-from: type=registry,ref=ghcr.io/cyclus/cyclus_rocky_${{ matrix.rocky_versions }}/cyclus:ci-layer-cache | |
file: docker/Rocky.dockerfile | |
push: true | |
tags: | | |
ghcr.io/cyclus/cyclus_rocky_${{ matrix.rocky_versions }}/cyclus:${{ env.version_tag }} | |
ghcr.io/cyclus/cyclus_rocky_${{ matrix.rocky_versions }}/cyclus:${{ env.stable_tag }} | |
build-args: | | |
rocky_version=${{ matrix.rocky_versions }} | |
core_version=${{ env.core_version }} |