Skip to content

DEB publish with new infra #47

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

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
43 changes: 28 additions & 15 deletions .github/workflows/publish-casper-db-utils-deb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ jobs:
include:
- os: ubuntu-20.04
code_name: focal
- os: ubuntu-22.04
code_name: jammy
- os: ubuntu-24.04
code_name: noble

runs-on: ${{ matrix.os }}

Expand All @@ -23,12 +27,19 @@ jobs:
toolchain: stable
profile: minimal

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_ACCESS_ROLE_REPO }}
role-session-name: GitHub_to_AWS_via_FederatedOIDC
aws-region: ${{ secrets.AWS_ACCESS_REGION_REPO }}

- name: Install deps
run: |
echo "deb http://repo.aptly.info/ squeeze main" | sudo tee -a /etc/apt/sources.list.d/aptly.list
wget -qO - https://www.aptly.info/pubkey.txt | sudo apt-key add -
sudo apt-get update
sudo apt-get install -y awscli aptly=1.2.0
sudo apt-get install -y aptly=1.4.0
aptly config show

- name: Import GPG key
Expand All @@ -52,28 +63,30 @@ jobs:
- name: Cargo deb
uses: actions-rs/cargo@v1
with:
command: deb
command: deb --no-build --variant ${{ matrix.code_name }}

- name: Upload binaries to repo
env:
AWS_SECRET_ACCESS_KEY: ${{ secrets.APTLY_SECRET_KEY }}
AWS_ACCESS_KEY_ID: ${{ secrets.APTLY_ACCESS_KEY }}
PLUGIN_REPO_NAME: ${{ secrets.APTLY_REPO }}
PLUGIN_REGION: ${{ secrets.APTLY_REGION }}
PLUGIN_REPO_NAME: ${{ secrets.AWS_BUCKET_REPO }}
PLUGIN_REGION: ${{ secrets.AWS_ACCESS_REGION_REPO }}
PLUGIN_GPG_KEY: ${{ secrets.APTLY_GPG_KEY }}
PLUGIN_GPG_PASS: ${{ secrets.APTLY_GPG_PASS }}
PLUGIN_ACL: 'public-read'
PLUGIN_ACL: 'private'
PLUGIN_PREFIX: 'releases'
PLUGIN_DEB_PATH: './target/debian'
PLUGIN_OS_CODENAME: ${{ matrix.code_name }}
run: ./ci/publish_deb_to_repo.sh

- name: Invalidate cloudfront
uses: chetan/invalidate-cloudfront-action@v1
env:
DISTRIBUTION: ${{ secrets.APTLY_DIST_ID }}
PATHS: "/*"
AWS_REGION: ${{ secrets.APTLY_REGION }}
AWS_ACCESS_KEY_ID: ${{ secrets.APTLY_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.APTLY_SECRET_KEY }}
- name: Invalidate CloudFront cache
run: |
aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_CLOUDFRONT_REPO }} --paths "/*"

- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/debian/casper-db-utils*
tag: ${{ github.ref }}
overwrite: true
file_glob: true

2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 22 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[package]
name = "casper-db-utils"
version = "0.1.0-dev+casper.node.1.4.15"
authors = ["George Pisaltu <[email protected]>"]
version = "0.1.0"
authors = ["George Pisaltu <[email protected]>", "Joe Sacher <[email protected]>"]
edition = "2021"
description = "Utilities for working with databases of the Casper blockchain."
documentation = "https://docs.rs/casper-db-utils"
readme = "README.md"
homepage = "https://casperlabs.io"
homepage = "https://casper.network"
repository = "https://github.com/casper-network/casper-db-utils"
license = "Apache-2.0"
build = "build.rs"
Expand Down Expand Up @@ -41,3 +41,22 @@ tempfile = "3"

[build-dependencies]
cargo-lock = { version = "9.0", default-features = false }

[package.metadata.deb]
revision = "0"
assets = [["./target/release/casper-db-utils", "/usr/bin/casper-db-utils", "755"]]
extended-description = """
Package for Casper DB Utils to perform various actions on a Casper-Node database.
"""

[package.metadata.deb.variants.focal]
name = "casper-db-utils"
revision = "0+focal"

[package.metadata.deb.variants.jammy]
name = "casper-db-utils"
revision = "0+jammy"

[package.metadata.deb.variants.noble]
name = "casper-db-utils"
revision = "0+noble"
2 changes: 2 additions & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[toolchain]
channel = "1.80.0"
Loading