Skip to content

Update Lotus versions #36

Update Lotus versions

Update Lotus versions #36

name: Build
on:
push:
branches:
- 'main'
tags:
- 'v*'
pull_request:
jobs:
build:
name: Containers
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
version:
- v1.24.0
- v1.24.1
- v1.25.0
- v1.25.1
- v1.25.2
- v1.26.0-rc1
net:
- name: mainnet
goflags: ''
- name: devnet
goflags: '-tags=debug'
platform:
- linux/amd64,linux/arm64
steps:
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata for Lotus ${{ matrix.version }} ${{ matrix.net.name }}
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=raw,value=lotus-${{ matrix.version }}-${{ matrix.net.name }}
- name: Check if image exists
id: checker
run: |
if ! docker manifest inspect ${{ steps.meta.outputs.tags }}
then
echo "IMAGE_EXISTS=false" >> $GITHUB_ENV
fi
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
if: env.IMAGE_EXISTS == 'false'
with:
tool-cache: false
android: true
dotnet: true
haskell: true
- name: Checkout
uses: actions/checkout@v3
if: env.IMAGE_EXISTS == 'false'
with:
repository: filecoin-project/lotus
ref: ${{ matrix.version }}
path: lotus
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
if: env.IMAGE_EXISTS == 'false'
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
if: env.IMAGE_EXISTS == 'false'
with:
platforms: ${{ matrix.platform }}
- name: Build Lotus ${{ matrix.version }} ${{ matrix.net.name }}
uses: docker/build-push-action@v4
if: env.IMAGE_EXISTS == 'false'
env:
REGISTRY_CACHE_REF: ghcr.io/${{ github.repository }}:cache
with:
context: lotus
cache-from: type=registry,ref=${{ env.REGISTRY_CACHE_REF }}
cache-to: type=registry,mode=max,ref=${{ env.REGISTRY_CACHE_REF }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: ${{ matrix.platform }}
build-args: |
GOFLAGS=${{ matrix.net.goflags }}