Skip to content

Commit

Permalink
Publish edge rad CLI binaries to ./rad instead of `./dist/os_arch/r…
Browse files Browse the repository at this point in the history
…elease/rad` (radius-project#6634)

# Description

This fixes the edge rad publishing to be just the binary instead of the
full path

## Type of change

<!--

Please select **one** of the following options that describes your
change and delete the others. Clearly identifying the type of change you
are making will help us review your PR faster, and is used in authoring
release notes.

If you are making a bug fix or functionality change to Radius and do not
have an associated issue link please create one now.

-->

- This pull request fixes a bug in Radius and has an approved issue
(issue link required).
- This pull request adds or changes features of Radius and has an
approved issue (issue link required).
- This pull request is a minor refactor, code cleanup, test improvement,
or other maintenance task and doesn't change the functionality of Radius
(issue link optional).

<!--

Please update the following to link the associated issue. This is
required for some kinds of changes (see above).

-->

Fixes: radius-project#6633

## Auto-generated summary

<!--
GitHub Copilot for docs will auto-generate a summary of the PR
-->

<!--
copilot:all
-->
### <samp>🤖 Generated by Copilot at 5d814c2</samp>

### Summary
:package::whale::zap:

<!--
1. :package: This emoji represents the packaging or bundling of the rad
binary into a single file that can be easily distributed and executed.
It also implies that the change is related to the build or release
process of the project.
2. :whale: This emoji represents the Docker or container aspect of the
change, as it involves pushing the rad binary to a container registry
using oras. It also implies that the change is related to the deployment
or distribution of the project.
3. :zap: This emoji represents the optimization or performance
improvement of the change, as it reduces the image size and removes
unnecessary files from the image. It also implies that the change is
related to the speed or efficiency of the project.
-->
The pull request optimizes the image size and structure of the `rad` cli
binaries by copying them to the root directory before pushing them with
`oras`. The change affects the `.github/workflows/build.yaml` file.

> _`rad` binary copied_
> _to root before container push_
> _smaller image, spring cleaning_

### Walkthrough
* Copy rad binary to root directory before pushing to container registry
([link](https://github.com/radius-project/radius/pull/6634/files?diff=unified&w=0#diff-d0777657fa3fd81d23aaf7273e58aee453b04e67882517900c56daeef9b3e4c1L219-R225))

Signed-off-by: willdavsmith <willdavsmith@gmail.com>
  • Loading branch information
willdavsmith authored Nov 3, 2023
1 parent d680f7d commit 2a0b9dc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,13 @@ jobs:
- name: Push latest rad cli binary to GHCR (unix-like)
if: github.ref == 'refs/heads/main' && matrix.target_os != 'windows'
run: |
oras push ${{ env.CONTAINER_REGISTRY }}/rad/${{ matrix.target_os }}-${{ matrix.target_arch }}:latest ./dist/${{ matrix.target_os}}_${{ matrix.target_arch}}/release/rad --annotation "org.opencontainers.image.source=${{ env.IMAGE_SRC }}"
cp ./dist/${{ matrix.target_os}}_${{ matrix.target_arch}}/release/rad ./rad
oras push ${{ env.CONTAINER_REGISTRY }}/rad/${{ matrix.target_os }}-${{ matrix.target_arch }}:latest ./rad --annotation "org.opencontainers.image.source=${{ env.IMAGE_SRC }}"
- name: Copy cli binaries to release (windows)
if: github.ref == 'refs/heads/main' && matrix.target_os == 'windows'
run: |
oras push ${{ env.CONTAINER_REGISTRY }}/rad/${{ matrix.target_os }}-${{ matrix.target_arch }}:latest ./dist/${{ matrix.target_os}}_${{ matrix.target_arch}}/release/rad.exe --annotation "org.opencontainers.image.source=${{ env.IMAGE_SRC }}"
cp ./dist/${{ matrix.target_os}}_${{ matrix.target_arch}}/release/rad.exe ./rad.exe
oras push ${{ env.CONTAINER_REGISTRY }}/rad/${{ matrix.target_os }}-${{ matrix.target_arch }}:latest .rad.exe --annotation "org.opencontainers.image.source=${{ env.IMAGE_SRC }}"
build-and-push-images:
name: Build and publish container images
Expand Down

0 comments on commit 2a0b9dc

Please sign in to comment.