Skip to content

Commit d4f6e3d

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

File tree

3 files changed

+118
-11
lines changed

3 files changed

+118
-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: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
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: Install Dependencies
51+
run: ./setup-test-env.sh
52+
- name: 'Echo RELEASE_TAG ENV'
53+
run: echo ${{ env.RELEASE_TAG }}
54+
55+
- name: Install Go licenses
56+
run: go install github.com/google/go-licenses@latest
57+
- name: Create Third Party Licences File
58+
run: make licenses
59+
- name: setup static dependecies
60+
run: |
61+
sudo apt-get update
62+
sudo apt-get install libc6-dev -f
63+
- name: Create release binaries
64+
run: make RELEASE_TAG=${{ env.RELEASE_TAG }} release
65+
- name: Verify Release version
66+
run: |
67+
mkdir -p output/static output/dynamic
68+
tar -xzf release/${{ env.DYNAMIC_BINARY_NAME }} -C ./output/dynamic
69+
tar -xzf release/${{ env.STATIC_BINARY_NAME }} -C ./output/static
70+
DYNAMIC_BINARY_VERSION=$(./output/dynamic/finch-daemon --version | grep -oP '\d+\.\d+\.\d+')
71+
STATIC_BINARY_VERSION=$(./output/static/finch-daemon --version | grep -oP '\d+\.\d+\.\d+')
72+
export release_tag=${{ env.RELEASE_TAG }}
73+
export release_version=${release_tag/v/}
74+
if ["$STATIC_BINARY_VERSION" != "$release_version"] || ["$DYNAMIC_BINARY_VERSION" != "$release_version"]; then
75+
echo "Version mismatch"
76+
exit 1
77+
fi
78+
shell: bash
79+
- uses: actions/upload-artifact@v4
80+
with:
81+
name: artifacts
82+
path: release/
83+
if-no-files-found: error
84+
outputs:
85+
release_tag: ${{ env.RELEASE_TAG }}
86+
dynamic_binary_name: ${{ env.DYNAMIC_BINARY_NAME }}
87+
static_binary_name: ${{ env.STATIC_BINARY_NAME }}
88+
validate-artifacts:
89+
needs: generate-artifacts
90+
runs-on: ubuntu-latest
91+
steps:
92+
- uses: actions/checkout@v4
93+
- uses: actions/download-artifact@v4
94+
with:
95+
name: artifacts
96+
path: release/
97+
- run: bash scripts/verify-release-artifacts.sh ${{ needs.generate-artifacts.outputs.release_tag }}
98+
# create-release:
99+
# needs: [generate-artifacts, validate-artifacts]
100+
# runs-on: ubuntu-latest
101+
# steps:
102+
# - uses: actions/checkout@v4
103+
# - uses: actions/download-artifact@v4
104+
# with:
105+
# name: artifacts
106+
# - uses: softprops/action-gh-release@v2
107+
# with:
108+
# tag_name: ${{ needs.generate-artifacts.outputs.release_tag }}
109+
# prerelease: false
110+
# generate_release_notes: false
111+
# files: |
112+
# ${{ needs.generate-artifacts.outputs.dynamic_binary_name }}
113+
# ${{ needs.generate-artifacts.outputs.dynamic_binary_name }}.sha256sum
114+
# ${{ needs.generate-artifacts.outputs.static_binary_name }}
115+
# ${{ needs.generate-artifacts.outputs.static_binary_name }}.sha256sum

0 commit comments

Comments
 (0)