Skip to content

Commit 3380a62

Browse files
committed
fix: test changes
Signed-off-by: Arjun Raja Yogidas <[email protected]>
1 parent e44eac8 commit 3380a62

File tree

3 files changed

+116
-11
lines changed

3 files changed

+116
-11
lines changed

.github/workflows/ci.yaml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,5 @@
11
name: CI
22
on:
3-
push:
4-
branches:
5-
- main
6-
paths-ignore:
7-
- '**.md'
8-
pull_request:
9-
branches:
10-
- main
11-
paths-ignore:
12-
- '**.md'
133
workflow_dispatch:
144
env:
155
GO_VERSION: '1.23.0'

.github/workflows/release-automation.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ jobs:
2222
uses: "WyriHaximus/github-action-get-previous-tag@04e8485ecb6487243907e330d522ff60f02283ce" # v1.4.0
2323
generate-artifacts:
2424
needs: get-latest-tag
25-
runs-on: ubuntu-20.04
25+
runs-on: ubuntu-22.04
26+
container:
27+
image: public.ecr.aws/ubuntu/ubuntu:20.04
2628
env:
2729
# Set during setup.
2830
RELEASE_TAG: ${{ needs.get-latest-tag.outputs.tag }}

.github/workflows/test.yaml

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
name: Release Finch Daemon
2+
on:
3+
push:
4+
branches:
5+
- main
6+
paths-ignore:
7+
- '**.md'
8+
pull_request:
9+
branches:
10+
- main
11+
paths-ignore:
12+
- '**.md'
13+
workflow_dispatch:
14+
env:
15+
GO_VERSION: '1.22.7'
16+
permissions:
17+
contents: write
18+
deployments: write
19+
jobs:
20+
get-latest-tag:
21+
name: Get the latest release tag
22+
runs-on: ubuntu-latest
23+
outputs:
24+
tag: ${{ steps.latest-tag.outputs.tag }}
25+
steps:
26+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
27+
with:
28+
fetch-depth: 0
29+
- name: 'Get the latest tag'
30+
id: latest-tag
31+
uses: "WyriHaximus/github-action-get-previous-tag@04e8485ecb6487243907e330d522ff60f02283ce" # v1.4.0
32+
generate-artifacts:
33+
needs: get-latest-tag
34+
runs-on: ubuntu-22.04
35+
container:
36+
image: public.ecr.aws/ubuntu/ubuntu:20.04
37+
env:
38+
# Set during setup.
39+
RELEASE_TAG: ${{ needs.get-latest-tag.outputs.tag }}
40+
DYNAMIC_BINARY_NAME: ''
41+
STATIC_BINARY_NAME: ''
42+
steps:
43+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
44+
with:
45+
fetch-tags: true
46+
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
47+
with:
48+
go-version: ${{ env.GO_VERSION }}
49+
cache: false
50+
- name: 'Echo RELEASE_TAG ENV'
51+
run: echo ${{ env.RELEASE_TAG }}
52+
53+
- name: Install Go licenses
54+
run: go install github.com/google/go-licenses@latest
55+
- name: Create Third Party Licences File
56+
run: make licenses
57+
- name: setup static dependecies
58+
run: |
59+
sudo apt-get update
60+
sudo apt-get install libc6-dev -f
61+
- name: Create release binaries
62+
run: make RELEASE_TAG=${{ env.RELEASE_TAG }} release
63+
- name: Verify Release version
64+
run: |
65+
mkdir -p output/static output/dynamic
66+
tar -xzf release/${{ env.DYNAMIC_BINARY_NAME }} -C ./output/dynamic
67+
tar -xzf release/${{ env.STATIC_BINARY_NAME }} -C ./output/static
68+
DYNAMIC_BINARY_VERSION=$(./output/dynamic/finch-daemon --version | grep -oP '\d+\.\d+\.\d+')
69+
STATIC_BINARY_VERSION=$(./output/static/finch-daemon --version | grep -oP '\d+\.\d+\.\d+')
70+
export release_tag=${{ env.RELEASE_TAG }}
71+
export release_version=${release_tag/v/}
72+
if ["$STATIC_BINARY_VERSION" != "$release_version"] || ["$DYNAMIC_BINARY_VERSION" != "$release_version"]; then
73+
echo "Version mismatch"
74+
exit 1
75+
fi
76+
shell: bash
77+
- uses: actions/upload-artifact@v4
78+
with:
79+
name: artifacts
80+
path: release/
81+
if-no-files-found: error
82+
outputs:
83+
release_tag: ${{ env.RELEASE_TAG }}
84+
dynamic_binary_name: ${{ env.DYNAMIC_BINARY_NAME }}
85+
static_binary_name: ${{ env.STATIC_BINARY_NAME }}
86+
validate-artifacts:
87+
needs: generate-artifacts
88+
runs-on: ubuntu-latest
89+
steps:
90+
- uses: actions/checkout@v4
91+
- uses: actions/download-artifact@v4
92+
with:
93+
name: artifacts
94+
path: release/
95+
- run: bash scripts/verify-release-artifacts.sh ${{ needs.generate-artifacts.outputs.release_tag }}
96+
# create-release:
97+
# needs: [generate-artifacts, validate-artifacts]
98+
# runs-on: ubuntu-latest
99+
# steps:
100+
# - uses: actions/checkout@v4
101+
# - uses: actions/download-artifact@v4
102+
# with:
103+
# name: artifacts
104+
# - uses: softprops/action-gh-release@v2
105+
# with:
106+
# tag_name: ${{ needs.generate-artifacts.outputs.release_tag }}
107+
# prerelease: false
108+
# generate_release_notes: false
109+
# files: |
110+
# ${{ needs.generate-artifacts.outputs.dynamic_binary_name }}
111+
# ${{ needs.generate-artifacts.outputs.dynamic_binary_name }}.sha256sum
112+
# ${{ needs.generate-artifacts.outputs.static_binary_name }}
113+
# ${{ needs.generate-artifacts.outputs.static_binary_name }}.sha256sum

0 commit comments

Comments
 (0)