Skip to content

Commit

Permalink
Publish only binaries, protobuf model and license (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
filip-szweda authored Oct 4, 2023
1 parent fbae56d commit 9c2f2cc
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .github/actions/set-environment-variables/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ runs:
printf "RELEASE_PATH=%s\n" "${{ github.workspace }}/build/Release" >> $GITHUB_ENV
printf "ARTIFACT_PATH=%s\n" "${{ github.workspace }}/artifact" >> $GITHUB_ENV
repositoryName="$(printf "%s" "${{ github.repository }}" | sed -e "s/^${{ github.repository_owner }}\///")"
lowercaseRepositoryName="${repositoryName,,}"
printf "LOWERCASE_REPOSITORY_NAME=%s\n" "${lowercaseRepositoryName}" >> $GITHUB_ENV
Expand Down
22 changes: 17 additions & 5 deletions .github/workflows/build-test-and-publish-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,30 @@ jobs:
- name: Test
uses: ./.github/actions/test

- name: Move license to release directory
run: mv ${{ github.workspace }}/LICENSE ${{ env.RELEASE_PATH }}/LICENSE
- name: Create artifact directory
run: mkdir ${{ env.ARTIFACT_PATH }}

- name: Zip release directory contents
- name: Move license to artifact directory
run: mv ${{ github.workspace }}/LICENSE ${{ env.ARTIFACT_PATH }}/LICENSE

- name: Move protobuf model to artifact directory
run: mv ${{ env.RELEASE_PATH }}/libebpfdiscoveryproto/proto/ebpfdiscoveryproto ${{ env.ARTIFACT_PATH }}/ebpfdiscoveryproto

- name: Move binaries to artifact directory
run: mv ${{ env.RELEASE_PATH }}/bin ${{ env.ARTIFACT_PATH }}/bin

- name: Remove test binaries from artifact directory
run: find ${{ env.ARTIFACT_PATH }}/* -name 'test*' -exec rm {} \;

- name: Zip artifact directory contents
run: |
cd ${{ env.RELEASE_PATH }}
cd ${{ env.ARTIFACT_PATH }}
zip -r ${{ env.GITHUB_OCI_REGISTRY_ARTIFACT_VERSION }}.zip .
- name: Login to GitHub OCI registry
run: printf "%s" ${{ secrets.GITHUB_TOKEN }} | oras login ghcr.io -u ${{ github.actor }} --password-stdin

- name: Publish zip to GitHub OCI registry
run: |
cd ${{ env.RELEASE_PATH }}
cd ${{ env.ARTIFACT_PATH }}
oras push ${{ env.GITHUB_OCI_REGISTRY_ADDRESS }}:${{ env.GITHUB_OCI_REGISTRY_ARTIFACT_VERSION }} ${{ env.GITHUB_OCI_REGISTRY_ARTIFACT_VERSION }}.zip

0 comments on commit 9c2f2cc

Please sign in to comment.