Skip to content

Commit 68fdcc0

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

File tree

3 files changed

+122
-11
lines changed

3 files changed

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

0 commit comments

Comments
 (0)