Skip to content

Commit 47da44f

Browse files
authored
Merge pull request #62 from sacherjj/ci-publish-update
CI publish update
2 parents e115305 + bd79fe8 commit 47da44f

File tree

15 files changed

+294
-681
lines changed

15 files changed

+294
-681
lines changed

.github/workflows/casper-node-launcher-pr.yml

Lines changed: 22 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -5,63 +5,36 @@ name: Continuous Integration
55
jobs:
66
test:
77
name: Test Suite
8-
runs-on: ubuntu-20.04
9-
steps:
10-
- uses: actions/checkout@v2
11-
- uses: actions-rs/toolchain@v1
12-
with:
13-
profile: minimal
14-
toolchain: stable
15-
override: true
16-
- uses: actions-rs/cargo@v1
17-
with:
18-
command: test
8+
strategy:
9+
matrix:
10+
include:
11+
- os: ubuntu-20.04
12+
code_name: focal
1913

20-
fmt:
21-
name: Rustfmt
22-
runs-on: ubuntu-20.04
23-
steps:
24-
- uses: actions/checkout@v2
25-
- uses: actions-rs/toolchain@v1
26-
with:
27-
profile: minimal
28-
toolchain: stable
29-
override: true
30-
- run: rustup component add rustfmt
31-
- uses: actions-rs/cargo@v1
32-
with:
33-
command: fmt
34-
args: -- --check
14+
runs-on: ${{ matrix.os }}
3515

36-
clippy:
37-
name: Clippy
38-
runs-on: ubuntu-20.04
3916
steps:
4017
- uses: actions/checkout@v2
4118
- uses: actions-rs/toolchain@v1
4219
with:
4320
profile: minimal
4421
toolchain: stable
4522
override: true
46-
- run: rustup component add clippy
47-
- uses: actions-rs/cargo@v1
48-
with:
49-
command: clippy
50-
args: -- -D warnings
5123

52-
audit:
53-
name: Audit
54-
runs-on: ubuntu-20.04
55-
steps:
56-
- uses: actions/checkout@v2
57-
- uses: actions-rs/toolchain@v1
58-
with:
59-
profile: minimal
60-
toolchain: stable
61-
override: true
62-
- run: cargo install cargo-audit
63-
- uses: actions-rs/cargo@v1
64-
with:
65-
command: audit
66-
args: --deny warnings --ignore RUSTSEC-2021-0145
24+
- name: rustup setup
25+
run: rustup component add rustfmt clippy
26+
27+
- name: cargo setup
28+
run: cargo install cargo-audit
29+
30+
- name: fmt
31+
run: cargo fmt -- --check
32+
33+
- name: clippy
34+
run: cargo clippy -- -D warnings
35+
36+
- name: audit
37+
run: cargo audit --deny warnings --ignore RUSTSEC-2024-0375 --ignore RUSTSEC-2021-0145
6738

39+
- name: test
40+
run: cargo test

.github/workflows/casper-node-launcher-publish.yml

Lines changed: 77 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ name: publish-casper-node-launcher
44
on:
55
push:
66
tags:
7-
- "v*"
7+
- "v*.*.*"
88

99
jobs:
1010
publish_deb:
@@ -18,14 +18,13 @@ jobs:
1818

1919
steps:
2020
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b #v3.0.2
21-
- uses: Swatinem/rust-cache@cb2cf0cc7c5198d3364b9630e2c3d457f160790c #v1.4.0
2221

2322
- name: Install deps
2423
run: |
2524
echo "deb http://repo.aptly.info/ squeeze main" | sudo tee -a /etc/apt/sources.list.d/aptly.list
2625
wget -qO - https://www.aptly.info/pubkey.txt | sudo apt-key add -
2726
sudo apt-get update
28-
sudo apt-get install -y awscli aptly=1.2.0
27+
sudo apt-get install -y aptly=1.4.0
2928
aptly config show
3029
3130
- name: Import GPG key
@@ -64,4 +63,78 @@ jobs:
6463
PATHS: "/*"
6564
AWS_REGION: ${{ secrets.APTLY_REGION }}
6665
AWS_ACCESS_KEY_ID: ${{ secrets.APTLY_ACCESS_KEY }}
67-
AWS_SECRET_ACCESS_KEY: ${{ secrets.APTLY_SECRET_KEY }}
66+
AWS_SECRET_ACCESS_KEY: ${{ secrets.APTLY_SECRET_KEY }}
67+
68+
---
69+
name: publish-casper-sidecar-deb
70+
permissions:
71+
contents: read
72+
id-token: write
73+
74+
on:
75+
push:
76+
tags:
77+
- "v*.*.*"
78+
79+
jobs:
80+
publish_deb:
81+
strategy:
82+
matrix:
83+
include:
84+
- os: ubuntu-20.04
85+
code_name: focal
86+
# - os: ubuntu-22.04
87+
# code_name: jammy
88+
# - os: ubuntu-24.04
89+
# code_name: noble
90+
91+
runs-on: ${{ matrix.os }}
92+
93+
steps:
94+
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b #v3.0.2
95+
96+
- name: Configure AWS credentials
97+
uses: aws-actions/configure-aws-credentials@v4
98+
with:
99+
role-to-assume: ${{ secrets.AWS_ACCESS_ROLE_REPO }}
100+
role-session-name: GitHub_to_AWS_via_FederatedOIDC
101+
aws-region: ${{ secrets.AWS_ACCESS_REGION_REPO }}
102+
103+
- name: Install deps
104+
run: |
105+
echo "deb http://repo.aptly.info/ squeeze main" | sudo tee -a /etc/apt/sources.list.d/aptly.list
106+
wget -qO - https://www.aptly.info/pubkey.txt | sudo apt-key add -
107+
sudo apt-get update
108+
sudo apt-get install -y aptly=1.4.0
109+
aptly config show
110+
111+
- name: update toolchain
112+
run: rustup update nightly
113+
114+
- name: Import GPG key
115+
uses: crazy-max/ghaction-import-gpg@c8bb57c57e8df1be8c73ff3d59deab1dbc00e0d1 #v5.1.0
116+
with:
117+
gpg_private_key: ${{ secrets.APTLY_GPG_KEY }}
118+
passphrase: ${{ secrets.APTLY_GPG_PASS }}
119+
120+
- name: Install cargo deb
121+
run: cargo install cargo-deb
122+
123+
- name: Cargo deb
124+
run: cargo deb --package casper-sidecar --variant ${{ matrix.code_name }}
125+
126+
- name: Upload binaries to repo
127+
env:
128+
PLUGIN_REPO_NAME: ${{ secrets.AWS_BUCKET_REPO }}
129+
PLUGIN_REGION: ${{ secrets.AWS_ACCESS_REGION_REPO }}
130+
PLUGIN_GPG_KEY: ${{ secrets.APTLY_GPG_KEY }}
131+
PLUGIN_GPG_PASS: ${{ secrets.APTLY_GPG_PASS }}
132+
PLUGIN_ACL: 'private'
133+
PLUGIN_PREFIX: 'releases'
134+
PLUGIN_DEB_PATH: './target/debian'
135+
PLUGIN_OS_CODENAME: ${{ matrix.code_name }}
136+
run: ./ci/publish_deb_to_repo.sh
137+
138+
- name: Invalidate CloudFront cache
139+
run: |
140+
aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_CLOUDFRONT_REPO }} --paths "/*"

.rpm/casper-node-launcher.spec

Lines changed: 0 additions & 104 deletions
This file was deleted.

0 commit comments

Comments
 (0)