Skip to content

Commit

Permalink
GH actions: upload agent binaries to GH releases
Browse files Browse the repository at this point in the history
  • Loading branch information
def committed Mar 8, 2024
1 parent f5b57ed commit 05c8383
Showing 1 changed file with 47 additions and 1 deletion.
48 changes: 47 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
contents: write
packages: write

steps:
Expand Down Expand Up @@ -45,3 +45,49 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
build-args: |
VERSION=${{ steps.meta.outputs.version }}
- name: extract amd64 binary from the image
run: |
docker create --platform linux/amd64 --name amd64 ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.version }} &&
docker cp amd64:/usr/bin/coroot-node-agent /tmp/coroot-node-agent-amd64
- name: extract arm64 binary from the image
run: |
docker create --platform linux/arm64 --name arm64 ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.version }} &&
docker cp arm64:/usr/bin/coroot-node-agent /tmp/coroot-node-agent-arm64
- name: upload amd64 binary
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: /tmp/coroot-node-agent-amd64
asset_name: coroot-node-agent-amd64
asset_content_type: application/octet-stream

- name: upload arm64 binary
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: /tmp/coroot-node-agent-arm64
asset_name: coroot-node-agent-arm64
asset_content_type: application/octet-stream

- uses: actions/github-script@v7
env:
RELEASE_ID: ${{ github.event.release.id }}
with:
script: |
const { RELEASE_ID } = process.env
github.rest.repos.updateRelease({
owner: context.repo.owner,
repo: context.repo.repo,
release_id: `${RELEASE_ID}`,
prerelease: false,
make_latest: true
})

0 comments on commit 05c8383

Please sign in to comment.