From 578d652273b3e9f427d0bb6a099979669fecff3d Mon Sep 17 00:00:00 2001 From: Nabiev Anush Date: Thu, 8 Feb 2024 14:53:37 +0300 Subject: [PATCH] feat: add git actions deploy --- .github/workflows/release.yml | 67 +++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..df9f6a45 --- /dev/null +++ b/.github/workflows/release.yml @@ -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"