From e841d87522159131cb864bb8ba5de67abd03efc5 Mon Sep 17 00:00:00 2001 From: Odysseas Lamtzidis Date: Tue, 28 Sep 2021 23:57:33 +0300 Subject: [PATCH] Initial Release workflow --- .github/workflows/release.yml | 98 +++++++++++++++++++++++++++++++++++ 1 file changed, 98 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 0000000000000..e327813e52a45 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,98 @@ +name: Dapptools-rs Release +on: + push: + tags: + - 'v*.*.*' + +env: + PACKAGE_NAME: + VERSION: + ARCHITECTURE: + DESCRIPTION: +jobs: + build-artifacts: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: + - ubuntu-latest + - macOS-latest + steps: + - name: Checkout sources + uses: actions/checkout@v2 + - name: Install toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + ovverride: true + - name: cargo build + uses: actions-rs/cargo@v1 + with: + command: build + args: --release + build-linux-packages: + runs-on: ubuntu-latest + needs: build-artifacts + steps: + - uses: actions/checkout@v2 + - uses: kentik/pkg@v1 + name: Build RPM package + id: build_rpm + with: + name: Dapptools-rs + version: ${{ github.ref }} + arch: x86_64 + format: rpm + package: packaging/package.yml + - uses: kentik/pkg@v1 + name: Build DEB package + id: build_deb + with: + name: Dapptools-rs + version: ${{ github.ref }} + arch: x86_64 + format: deb + package: packaging/package.yml + - name: Save artifacts + uses: actions/cache@2 + env: + cache-name: artiacts-cache + with: + path: | + ./${{ steps.build_deb.outputs.package }} + ./${{ steps.build_rpm.outputs.package }} + key: linux-packages-${{ github.ref }} + create-release: + runs-on: ubuntu-latest + needs: [build-linux-artifacts, build-artifacts] + steps: + - name: Restore artifacts + uses: actions/cache@2 + env: + cache-name: artiacts-cache + with: + path: | + ./${{ steps.build_deb.outputs.package }} + ./${{ steps.build_rpm.outputs.package }} + key: linux-packages-${{ github.ref } + - name: Build Changelog + id: github_release + uses: mikepenz/release-changelog-builder-action@v2.4.2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Create Release + id: create-release + uses: softprops/action-gh-release@vv0.1.13 + env: + GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: ${{ github.ref }} + body: ${{steps.build_changelog.outputs.changelog}} + files: | + ./*.deb + ./*.rpm +