Skip to content

Commit

Permalink
CI: Shift workflows to local build, cleanup pipelines (#2717)
Browse files Browse the repository at this point in the history
* Revert genbuild

* Initial dev on build-dev ci workflow

* Fix dubious repo

* Shift docker defi build out of container

* Fix pkg name

* Add zip dep

* Fix populate env

* Remove incorrect copy command in defi dockerfile

* Revert dockerfile

* Fix sh check

* Clean up package dir

* Upgrade all checkout action to v4

* Add rust caching to build dev, release and staging

* Resolve copying package into docker image

* Remove dockerignore, fix release and staging builds

* Add git config to build dev

* Better rename

* Remove sudo privilege

* remove relative path

* Better rename

* Debug log

* Fix package path

* Better refactor

* Fix docker build

* Fix relative path
  • Loading branch information
sieniven committed Nov 24, 2023
1 parent 042bd3c commit cd29ac3
Show file tree
Hide file tree
Showing 13 changed files with 232 additions and 424 deletions.
87 changes: 42 additions & 45 deletions .github/workflows/build-dev.yaml
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}

0 comments on commit cd29ac3

Please sign in to comment.