Skip to content

Commit 96e5463

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

File tree

3 files changed

+123
-11
lines changed

3 files changed

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

0 commit comments

Comments
 (0)