-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature-swarm-387' into 'dev'
feat: add git actions deploy See merge request swarm/system/nftables/nft!17
- Loading branch information
Showing
1 changed file
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: release | ||
on: | ||
push: | ||
tags: | ||
- 'v[0-9]+.[0-9]+.[0-9]+.[0-9]+' | ||
- 'v[0-9]+.[0-9]+.[0-9]+.[0-9]+-rc[0-9]+' | ||
|
||
jobs: | ||
create-release: | ||
runs-on: ubuntu-20.04 | ||
permissions: | ||
contents: write | ||
|
||
steps: | ||
- name: Setup environment | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y libmnl-dev flex bison asciidoc libedit-dev libjansson-dev libxtables-dev | ||
sudo apt-get install ruby-dev build-essential | ||
sudo gem i fpm -f | ||
- name: Check out libnftnl repository | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: H-BF/libnftnl.git | ||
ref: dev | ||
fetch-depth: 0 | ||
|
||
- name: Build nft deb & rpm packages | ||
run: | | ||
./autogen.sh | ||
./configure '--with-pkgdst=/opt/swarm/' '--with-build-deb' | ||
make build-deb | ||
sudo apt install ./packages/deb/$(ls ./packages/deb | grep .deb) | ||
- name: Check out nft repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Build nft deb & rpm packages | ||
run: | | ||
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/opt/swarm/lib/pkgconfig/ | ||
./autogen.sh | ||
./configure '--with-pkgdst=/opt/swarm/' '--with-build-deb' '--with-build-rpm' '--with-json' | ||
make build-deb | ||
make build-rpm | ||
env: | ||
STRIPPED_VERSION: ${{ github.ref_name }} | ||
|
||
- name: Prepare sha256 checksum's | ||
run: | | ||
cd packages/deb | ||
sha256sum "$(ls | grep .deb)" > "$(ls | grep .deb)_sha256sum" | ||
cd ../rpm | ||
sha256sum "$(ls | grep .rpm)" > "$(ls | grep .rpm)_sha256sum" | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
path: "packages/*" | ||
|
||
- uses: ncipollo/release-action@v1 | ||
with: | ||
allowUpdates: true | ||
draft: True | ||
artifacts: "packages/deb/*.deb, packages/deb/*sha256sum, packages/rpm/*.rpm, packages/rpm/*sha256sum" |