Skip to content

Commit

Permalink
Merge branch 'feature-swarm-387' into 'dev'
Browse files Browse the repository at this point in the history
feat: add git actions deploy

See merge request swarm/system/nftables/nft!17
  • Loading branch information
nabiev.a5 committed Feb 8, 2024
2 parents 6826a11 + 578d652 commit 72c4d06
Showing 1 changed file with 67 additions and 0 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/release.yml
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"

0 comments on commit 72c4d06

Please sign in to comment.