Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add github action for eur2ccd release #27

Merged
merged 90 commits into from
Oct 22, 2024
Merged
Changes from 88 commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
ddbaaae
Add github action for eur2ccd release
EmilKWarmdahl Oct 11, 2024
6f06532
remove OUT_DIR
EmilKWarmdahl Oct 14, 2024
1b4db90
Change ref to main
EmilKWarmdahl Oct 14, 2024
b842796
Remove empty job
EmilKWarmdahl Oct 14, 2024
2cf2f2e
change variable format
EmilKWarmdahl Oct 14, 2024
2348336
Change var name
EmilKWarmdahl Oct 14, 2024
e92d83c
Change rust name
EmilKWarmdahl Oct 14, 2024
8e5693a
bump ubuntu version
EmilKWarmdahl Oct 14, 2024
bda37ee
Update variables to use double curly brackets
EmilKWarmdahl Oct 14, 2024
9609d4c
Add version varviable
EmilKWarmdahl Oct 14, 2024
0a94ee9
Use single quotes in variables
EmilKWarmdahl Oct 14, 2024
9519b6f
Add env to used variable
EmilKWarmdahl Oct 15, 2024
02b09ab
Remove env var
EmilKWarmdahl Oct 15, 2024
6b134fd
Add publish step
EmilKWarmdahl Oct 15, 2024
10a1e78
Use release.yaml to control whether we make a release
EmilKWarmdahl Oct 15, 2024
23f1fe6
Use tags for release
EmilKWarmdahl Oct 15, 2024
0d86388
Revert to branch push
EmilKWarmdahl Oct 15, 2024
4fe3e9c
Test push stage
EmilKWarmdahl Oct 15, 2024
b0eef7b
Test push stage
EmilKWarmdahl Oct 15, 2024
7c1f594
Test push stage
EmilKWarmdahl Oct 15, 2024
becad0b
Test publish stage
EmilKWarmdahl Oct 15, 2024
2bc1293
Test publish stage
EmilKWarmdahl Oct 15, 2024
e898525
Use oidc for aws access
EmilKWarmdahl Oct 15, 2024
bdf3ad3
Configure aws credentials
EmilKWarmdahl Oct 15, 2024
27eccaf
Add permissions to get jwt
EmilKWarmdahl Oct 15, 2024
c390be7
Format
EmilKWarmdahl Oct 15, 2024
4105941
Format
EmilKWarmdahl Oct 15, 2024
20e91a8
Format
EmilKWarmdahl Oct 15, 2024
e11bcb2
Format
EmilKWarmdahl Oct 15, 2024
cd359e7
Make check to see if eur2ccd service has been built
EmilKWarmdahl Oct 16, 2024
09323f8
Look at tag
EmilKWarmdahl Oct 16, 2024
18c0c53
Change way to look at tag
EmilKWarmdahl Oct 16, 2024
30688a8
Change way to look at tag
EmilKWarmdahl Oct 16, 2024
b025b5d
Revert for testing
EmilKWarmdahl Oct 16, 2024
88494bf
Change environment
EmilKWarmdahl Oct 16, 2024
f18f743
Typo in role arn
EmilKWarmdahl Oct 16, 2024
a3a7332
Use tags
EmilKWarmdahl Oct 17, 2024
58f8bef
Use tags
EmilKWarmdahl Oct 17, 2024
ab035a9
Use tags
EmilKWarmdahl Oct 17, 2024
10e88b4
test
EmilKWarmdahl Oct 17, 2024
d7462e4
test
EmilKWarmdahl Oct 17, 2024
0f0daa2
test
EmilKWarmdahl Oct 17, 2024
9bc8464
test
EmilKWarmdahl Oct 17, 2024
c492302
test
EmilKWarmdahl Oct 17, 2024
d2e3e71
test
EmilKWarmdahl Oct 17, 2024
0abd856
test
EmilKWarmdahl Oct 17, 2024
db34fd2
test
EmilKWarmdahl Oct 17, 2024
3b35ac5
test
EmilKWarmdahl Oct 17, 2024
dd9337d
test
EmilKWarmdahl Oct 17, 2024
e86fde4
test
EmilKWarmdahl Oct 17, 2024
062eab6
test
EmilKWarmdahl Oct 17, 2024
d231d9c
test
EmilKWarmdahl Oct 17, 2024
ebf4790
test
EmilKWarmdahl Oct 17, 2024
677bf16
test
EmilKWarmdahl Oct 17, 2024
6b73b79
test
EmilKWarmdahl Oct 17, 2024
9abaf75
test
EmilKWarmdahl Oct 17, 2024
76a3f56
test
EmilKWarmdahl Oct 17, 2024
149d926
test
EmilKWarmdahl Oct 17, 2024
a4f707d
Use double hashtags for greedy delete
EmilKWarmdahl Oct 17, 2024
ba842b2
Use double hashtags for greedy delete
EmilKWarmdahl Oct 17, 2024
c3ea126
Use double hashtags for greedy delete
EmilKWarmdahl Oct 17, 2024
3c7a873
Use double hashtags for greedy delete
EmilKWarmdahl Oct 17, 2024
596f2fd
Use double percentage for greedy delete
EmilKWarmdahl Oct 17, 2024
fb85546
Use tags for releasing
EmilKWarmdahl Oct 17, 2024
cc59524
Use tags for releasing
EmilKWarmdahl Oct 17, 2024
d5caa98
Remove 'test' from artifact name
EmilKWarmdahl Oct 17, 2024
6522759
Try with failing step if binary is already in s3
EmilKWarmdahl Oct 21, 2024
0f352f4
Try with failing step if binary is already in s3
EmilKWarmdahl Oct 21, 2024
130fd2e
Try with failing step if binary is already in s3
EmilKWarmdahl Oct 21, 2024
a77687b
Try with failing step if binary is already in s3
EmilKWarmdahl Oct 21, 2024
9fc359a
Try with failing step if binary is already in s3
EmilKWarmdahl Oct 21, 2024
7d271a6
use github env
EmilKWarmdahl Oct 21, 2024
3e904f4
use github env
EmilKWarmdahl Oct 21, 2024
04fbf73
Test failing step
EmilKWarmdahl Oct 21, 2024
6034640
move IAM role to env vriable
EmilKWarmdahl Oct 21, 2024
114030b
Check version with cargo
EmilKWarmdahl Oct 21, 2024
dfec5a6
Test new if statement
EmilKWarmdahl Oct 21, 2024
3715c19
Typo
EmilKWarmdahl Oct 21, 2024
09e5f0f
Remove exit 1 from test
EmilKWarmdahl Oct 21, 2024
596d99c
Remove exit 1 from test
EmilKWarmdahl Oct 21, 2024
0111b4c
typo
EmilKWarmdahl Oct 21, 2024
4cc69f8
Update object name
EmilKWarmdahl Oct 21, 2024
6a1b265
Update object name
EmilKWarmdahl Oct 21, 2024
4c1e5db
Update object name
EmilKWarmdahl Oct 21, 2024
970038f
Update object name
EmilKWarmdahl Oct 21, 2024
6875541
Update object name
EmilKWarmdahl Oct 21, 2024
b0b26fd
Use tags again
EmilKWarmdahl Oct 21, 2024
2059ee5
print out found objects and remove unused env var
EmilKWarmdahl Oct 22, 2024
195de07
print out found objects
EmilKWarmdahl Oct 22, 2024
2fa9678
Send out ouput when exit code not equal 1
EmilKWarmdahl Oct 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Build and Push Database Exporter

on:
push:
tags:
- "*.*.*-*"

env:
UBUNTU_VERSION: '22.04'
RUST_IMAGE_TAG: '1.73.0'
OUTFILE: "s3://eur2ccd.concordium.com/concordium-eur2ccd_${{ github.ref_name }}_amd64.deb"
IAM_ROLE: "arn:aws:iam::192549843005:role/github_eur2ccd"

permissions:
id-token: write
contents: read

jobs:
release-euro2ccd:
runs-on: ubuntu-latest
environment: release
EmilKWarmdahl marked this conversation as resolved.
Show resolved Hide resolved
steps:
- name: Get the eur2ccd version
env:
TAG: ${{ github.ref_name }}
run: echo "EUR2CCD_VERSION=${TAG%%-*}" >> $GITHUB_ENV
EmilKWarmdahl marked this conversation as resolved.
Show resolved Hide resolved

- name: Checkout Repository
uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}
submodules: recursive

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: "eu-west-1"
role-to-assume: ${{ env.IAM_ROLE }}
role-session-name: ReleaseEur2ccdSession

- name: Get version from cargo.toml
run: |
VERSION=$(yq .package.version Cargo.toml)
echo "::notice FULL_IMAGE_TAG=${FULL_IMAGE_TAG}"
# Make sure the image does not exist. Abort if we can retrieve any metadata.
if [ ! "${{ env.EUR2CCD_VERSION }}" = "$VERSION" ]; then
echo "::error ${{ github.ref_name }} does not match ${{ env.SERVICE_NAME }}/${VERSION}."
exit 1
fi

- name: Check if version exist in s3
run: |
set +e
totalFoundObjects=$(aws s3 ls "${{env.OUTFILE}}")
EmilKWarmdahl marked this conversation as resolved.
Show resolved Hide resolved
ec=$?
if [ $ec -eq "0" ]; then
echo $totalFoundObjects
EmilKWarmdahl marked this conversation as resolved.
Show resolved Hide resolved
exit 1
elif [ $ec -eq "255"]; then
EmilKWarmdahl marked this conversation as resolved.
Show resolved Hide resolved
echo "error: You do not have aws access"
EmilKWarmdahl marked this conversation as resolved.
Show resolved Hide resolved
exit 1
fi

- name: Build
run: |
set -euxo pipefail
EmilKWarmdahl marked this conversation as resolved.
Show resolved Hide resolved
docker build -t ccd-service-builder --build-arg ubuntu_version=${{ env.UBUNTU_VERSION }} --build-arg rust_image_tag=${{ env.RUST_IMAGE_TAG }} -f scripts/debian-package/deb.Dockerfile .
id=$(docker create ccd-service-builder)
docker cp $id:/build/pkg-root/concordium-eur2ccd_${{ env.EUR2CCD_VERSION }}_amd64.deb .

- name: Publish
run: |
aws s3 cp concordium-eur2ccd_${{ env.EUR2CCD_VERSION }}_amd64.deb ${{ env.OUTFILE }}
Loading