diff --git a/.github/workflows/build_test.yml b/.github/workflows/build_test.yml index c212bfb..dcae703 100644 --- a/.github/workflows/build_test.yml +++ b/.github/workflows/build_test.yml @@ -19,9 +19,6 @@ on: jobs: build-and-test: runs-on: ubuntu-latest - permissions: - contents: read - packages: write strategy: fail-fast: false @@ -43,13 +40,6 @@ jobs: - name: Checkout Cymetric uses: actions/checkout@v4 - - 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: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -58,8 +48,7 @@ jobs: continue-on-error: true uses: docker/build-push-action@v5 with: - cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/cymetric_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }}/cymetric:ci-layer-cache - cache-to: type=registry,ref=ghcr.io/${{ github.repository_owner }}/cymetric_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }}/cymetric:ci-layer-cache,mode=max + cache-from: type=registry,ref=ghcr.io/cyclus/cymetric_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }}/cymetric:ci-layer-cache file: docker/Dockerfile build-args: | pkg_mgr=${{ matrix.pkg_mgr }} diff --git a/.github/workflows/publish_latest.yml b/.github/workflows/publish_latest.yml index 5ca76b1..61c9f75 100644 --- a/.github/workflows/publish_latest.yml +++ b/.github/workflows/publish_latest.yml @@ -46,7 +46,7 @@ jobs: uses: docker/login-action@v3 with: registry: ghcr.io - username: ${{ github.repository_owner }} + username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Set up Docker Buildx @@ -55,11 +55,11 @@ jobs: - name: Build and Test Cymetric uses: docker/build-push-action@v5 with: - cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/cymetric_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }}/cymetric:ci-layer-cache - cache-to: type=registry,ref=ghcr.io/${{ github.repository_owner }}/cymetric_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }}/cymetric:ci-layer-cache,mode=max + cache-from: type=registry,ref=ghcr.io/cyclus/cymetric_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }}/cymetric:ci-layer-cache + cache-to: type=registry,ref=ghcr.io/cyclus/cymetric_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }}/cymetric:ci-layer-cache,mode=max file: docker/Dockerfile push: true - tags: ghcr.io/${{ github.repository_owner }}/cymetric_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }}/cymetric:${{ env.tag }} + tags: ghcr.io/cyclus/cymetric_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }}/cymetric:${{ env.tag }} build-args: | pkg_mgr=${{ matrix.pkg_mgr }} ubuntu_version=${{ matrix.ubuntu_versions }} diff --git a/.github/workflows/publish_release.yml b/.github/workflows/publish_release.yml index 7353f0e..7d35649 100644 --- a/.github/workflows/publish_release.yml +++ b/.github/workflows/publish_release.yml @@ -1,6 +1,9 @@ name: Publish Stable Cymetric on: + pull_request: + paths: + - '.github/workflows/publish_release.yml' release: types: [released] @@ -31,7 +34,7 @@ jobs: echo "stable_tag=ci-image-cache" >> "$GITHUB_ENV" - name: Tag as stable - if: ${{ github.repository_owner == 'cyclus' }} + 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" @@ -40,7 +43,7 @@ jobs: uses: docker/login-action@v3 with: registry: ghcr.io - username: ${{ github.repository_owner }} + username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Set up Docker Buildx @@ -52,13 +55,12 @@ jobs: - name: Build and Test Cymetric uses: docker/build-push-action@v5 with: - cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/cymetric_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }}/cymetric:ci-layer-cache - cache-to: type=registry,ref=ghcr.io/${{ github.repository_owner }}/cymetric_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }}/cymetric:ci-layer-cache,mode=max + cache-from: type=registry,ref=ghcr.io/cyclus/cymetric_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }}/cymetric:ci-layer-cache file: docker/Dockerfile push: true tags: | - ghcr.io/${{ github.repository_owner }}/cymetric_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }}/cymetric:${{ env.version_tag }} - ghcr.io/${{ github.repository_owner }}/cymetric_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }}/cymetric:${{ env.stable_tag }} + ghcr.io/cyclus/cymetric_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }}/cymetric:${{ env.version_tag }} + ghcr.io/cyclus/cymetric_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }}/cymetric:${{ env.stable_tag }} build-args: | pkg_mgr=${{ matrix.pkg_mgr }} ubuntu_version=${{ matrix.ubuntu_versions }} diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 67b8e2e..38b3bbb 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -4,7 +4,7 @@ cymetric Change Log .. current developments **Added:** -* GitHub workflows for CI (#188, #190, #191, #193) +* GitHub workflows for CI (#188, #190, #191, #193, #195) **Changed** * Converted test suite from nose to pytest (#188) diff --git a/docker/Dockerfile b/docker/Dockerfile index 8149d21..720d047 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,6 +1,6 @@ ARG pkg_mgr=apt ARG ubuntu_version=22.04 -ARG cycamore_tag=stable +ARG cycamore_tag=latest FROM ghcr.io/cyclus/cycamore_${ubuntu_version}_${pkg_mgr}/cycamore:${cycamore_tag} as cymetric