-
Notifications
You must be signed in to change notification settings - Fork 8
60 lines (45 loc) · 1.97 KB
/
build-test-and-publish-release.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Build, test and publish Release
on:
push:
branches:
- main
jobs:
build-test-and-publish-release:
runs-on: ubuntu-latest
steps:
- name: Checkout source code of the repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Update packages
uses: ./.github/actions/update-packages
- name: Set environment variables
uses: ./.github/actions/set-environment-variables
with:
build-type: Release
- name: Install requirements
uses: ./.github/actions/install-requirements
- name: Configure
uses: ./.github/actions/configure
- name: Build
uses: ./.github/actions/build
- name: Test
uses: ./.github/actions/test
- name: Create artifact directory
run: mkdir ${{ env.ARTIFACT_PATH }}
- 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/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.ARTIFACT_PATH }}
zip -r ${{ env.ARTIFACT_VERSION }}.zip .
- name: Publish zip to GitHub OCI registry
run: |
cd ${{ env.ARTIFACT_PATH }}
printf "%s" ${{ secrets.GITHUB_TOKEN }} | docker run --rm -i -v $(pwd):/workspace ghcr.io/oras-project/oras:v1.0.1 push -u ${{ github.actor }} --password-stdin ${{ env.GITHUB_OCI_REGISTRY_ADDRESS }}/${{ env.LOWERCASE_REPOSITORY_NAME }}-linux-x86_64:${{ env.ARTIFACT_VERSION }},latest ${{ env.ARTIFACT_VERSION }}.zip