Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 42 additions & 45 deletions .github/workflows/build-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,74 +25,71 @@ env:
GIT_VERSION: 1

jobs:
linux-x64:
build:
runs-on: ubuntu-latest
container: defi/ain-builder:latest
strategy:
matrix:
target: [x86_64-pc-linux-gnu, x86_64-w64-mingw32, x86_64-apple-darwin]
env:
TARGET: x86_64-pc-linux-gnu
TARGET: ${{matrix.target}}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: git config --global --add safe.directory '*'

- name: Populate environment
run: ./make.sh ci-export-vars

- name: Build and package
run: ./make.sh docker-release
- name: Setup dependencies
run: ./make.sh ci-setup-deps

- name: Setup user dependencies
run: ./make.sh ci-setup-user-deps

- name: Publish artifact - x86_64-pc-linux-gnu
uses: actions/upload-artifact@v3
- uses: Swatinem/rust-cache@v2
with:
name: defichain-${{ env.BUILD_VERSION }}-x86_64-pc-linux-gnu
path: ./build/defichain-${{ env.BUILD_VERSION }}-x86_64-pc-linux-gnu.tar.gz

- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ env.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}

- name: Push to Docker Hub
run: |
set -e; ver=${{ env.BUILD_VERSION }}
docker tag defichain-x86_64-pc-linux-gnu:${ver} defi/defichain:${ver}
docker push defi/defichain:${ver}

win-x64:
runs-on: ubuntu-latest
env:
TARGET: x86_64-w64-mingw32

steps:
- uses: actions/checkout@v3

- name: Populate environment
run: ./make.sh ci-export-vars
workspaces: lib -> ../build/lib/target
save-if: ${{ github.ref == 'refs/heads/master' }}

- name: Build and package
run: ./make.sh docker-release
run: ./make.sh release

- name: Publish artifact - x86_64-w64-mingw32
- name: Publish artifact
uses: actions/upload-artifact@v3
with:
name: defichain-${{ env.BUILD_VERSION }}-x86_64-w64-mingw32
path: ./build/defichain-${{ env.BUILD_VERSION }}-x86_64-w64-mingw32.tar.gz
name: defichain-${{ env.BUILD_VERSION }}-${{ env.TARGET }}
path: ./build/defichain-${{ env.BUILD_VERSION }}-${{ env.TARGET }}.${{ env.PKG_TYPE }}

osx-x64:
docker-build:
runs-on: ubuntu-latest
needs: [build]
env:
TARGET: x86_64-apple-darwin
TARGET: x86_64-pc-linux-gnu

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: git config --global --add safe.directory '*'

- name: Populate environment
run: ./make.sh ci-export-vars

- name: Build and package
run: ./make.sh docker-release
- name: Download Binaries
uses: actions/download-artifact@v3
with:
name: defichain-${{ env.BUILD_VERSION }}-${{ env.TARGET }}

- name: Publish artifact - x86_64-apple-darwin
uses: actions/upload-artifact@v3
- name: Build defi image
run: rm .dockerignore && ./make.sh docker-defi-build

- name: Login to Docker Hub
uses: docker/login-action@v2
with:
name: defichain-${{ env.BUILD_VERSION }}-x86_64-apple-darwin
path: ./build/defichain-${{ env.BUILD_VERSION }}-x86_64-apple-darwin.tar.gz
username: ${{ env.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}

- name: Push to Docker Hub
run: |
set -e; ver=${{ env.BUILD_VERSION }}
docker tag defichain-${{ env.TARGET }}:${ver} defi/defichain:${ver}
docker push defi/defichain:${ver}
Loading