Skip to content

Commit 05c8383

Browse files
committed
GH actions: upload agent binaries to GH releases
1 parent f5b57ed commit 05c8383

File tree

1 file changed

+47
-1
lines changed

1 file changed

+47
-1
lines changed

.github/workflows/release.yml

+47-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
build:
1313
runs-on: ubuntu-latest
1414
permissions:
15-
contents: read
15+
contents: write
1616
packages: write
1717

1818
steps:
@@ -45,3 +45,49 @@ jobs:
4545
labels: ${{ steps.meta.outputs.labels }}
4646
build-args: |
4747
VERSION=${{ steps.meta.outputs.version }}
48+
49+
- name: extract amd64 binary from the image
50+
run: |
51+
docker create --platform linux/amd64 --name amd64 ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.version }} &&
52+
docker cp amd64:/usr/bin/coroot-node-agent /tmp/coroot-node-agent-amd64
53+
54+
- name: extract arm64 binary from the image
55+
run: |
56+
docker create --platform linux/arm64 --name arm64 ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.version }} &&
57+
docker cp arm64:/usr/bin/coroot-node-agent /tmp/coroot-node-agent-arm64
58+
59+
- name: upload amd64 binary
60+
uses: actions/upload-release-asset@v1
61+
env:
62+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
63+
with:
64+
upload_url: ${{ github.event.release.upload_url }}
65+
asset_path: /tmp/coroot-node-agent-amd64
66+
asset_name: coroot-node-agent-amd64
67+
asset_content_type: application/octet-stream
68+
69+
- name: upload arm64 binary
70+
uses: actions/upload-release-asset@v1
71+
env:
72+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
73+
with:
74+
upload_url: ${{ github.event.release.upload_url }}
75+
asset_path: /tmp/coroot-node-agent-arm64
76+
asset_name: coroot-node-agent-arm64
77+
asset_content_type: application/octet-stream
78+
79+
- uses: actions/github-script@v7
80+
env:
81+
RELEASE_ID: ${{ github.event.release.id }}
82+
with:
83+
script: |
84+
const { RELEASE_ID } = process.env
85+
github.rest.repos.updateRelease({
86+
owner: context.repo.owner,
87+
repo: context.repo.repo,
88+
release_id: `${RELEASE_ID}`,
89+
prerelease: false,
90+
make_latest: true
91+
})
92+
93+

0 commit comments

Comments
 (0)