Skip to content

Commit

Permalink
Merge pull request #397 from ava-labs/auto-build
Browse files Browse the repository at this point in the history
first run of test
  • Loading branch information
StephenButtolph authored Apr 23, 2021
2 parents 28e7d2d + 7d2c903 commit 95e0bef
Show file tree
Hide file tree
Showing 11 changed files with 284 additions and 142 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/build-deb-pkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ OK=`cp ./build/plugins/evm $AVALANCHE_LIB_DIR`
if [[ $OK -ne 0 ]]; then
exit $OK;
fi
OK=`cp $TEMPLATE/control-$ARCH $DEBIAN_CONF/control`
OK=`cp $TEMPLATE/control $DEBIAN_CONF/control`
if [[ $OK -ne 0 ]]; then
exit $OK;
fi
Expand All @@ -31,6 +31,8 @@ if [[ $TAG =~ ^v ]]; then
VER=$(echo $TAG | tr -d 'v')
fi
NEW_VERSION_STRING="Version: $VER"
NEW_ARCH_STRING="Architecture: $ARCH"
sed -i "s/Version.*/$NEW_VERSION_STRING/g" debian/DEBIAN/control
dpkg-deb --build debian avalanchego-linux-$ARCH-$TAG.deb
aws s3 cp avalanchego-linux-$ARCH-$TAG.deb s3://$BUCKET/linux/deb/
sed -i "s/Architecture.*/$NEW_ARCH_STRING/g" debian/DEBIAN/control
dpkg-deb --build debian avalanchego-$TAG-$ARCH.deb
aws s3 cp avalanchego-$TAG-$ARCH.deb s3://${BUCKET}/linux/debs/ubuntu/$RELEASE/$ARCH/
51 changes: 0 additions & 51 deletions .github/workflows/build-linux-arm64-release.yml

This file was deleted.

83 changes: 83 additions & 0 deletions .github/workflows/build-linux-binaries.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: build-linux-release

on:
push:
tags:
- '*'

jobs:
build-x86_64-binaries-tarball:
runs-on: ubuntu-18.04

steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '1.15.5' # The Go version to download (if necessary) and use.
- run: go version

- name: Build the avalanchego binaries
run: ./scripts/build.sh

- name: Install aws cli
run: |
sudo apt update
sudo apt-get install awscli
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
shell: bash

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1

- name: Create tgz package structure
run: ./.github/workflows/build-tgz-pkg.sh
env:
TAG: ${{ steps.get_version.outputs.VERSION }}
BUCKET: ${{ secrets.BUCKET }}
ARCH: "amd64"
RELEASE: "focal"

build-arm64-binaries-tarball:
runs-on: [self-hosted, linux, ARM64, bionic]

steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '1.15.5' # The Go version to download (if necessary) and use.
- run: go version

- name: Build the avalanchego binaries
run: ./scripts/build.sh

- name: Install aws cli
run: |
sudo apt update
sudo apt-get install awscli
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
shell: bash

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1

- name: Create tgz package structure
run: ./.github/workflows/build-tgz-pkg.sh
env:
TAG: ${{ steps.get_version.outputs.VERSION }}
BUCKET: ${{ secrets.BUCKET }}
ARCH: "arm64"
RELEASE: "focal"
69 changes: 0 additions & 69 deletions .github/workflows/build-linux-release.yml

This file was deleted.

16 changes: 12 additions & 4 deletions .github/workflows/build-macos-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,19 @@ jobs:
sudo installer -pkg AWSCLIV2.pkg -target /
- name: Create zip file
run: 7z a avalanchego-macos-${{ steps.get_version.outputs.VERSION }}.zip build/avalanchego build/plugins
run: 7z a avalanchego-macos-${VERSION}.zip build/avalanchego build/plugins
env:
VERSION: ${{ steps.get_version.outputs.VERSION }}

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1

- name: Upload file to S3
run: aws s3 cp avalanchego-macos-${{ steps.get_version.outputs.VERSION }}.zip s3://${{ secrets.BUCKET }}/macos/
run: aws s3 cp avalanchego-macos-${VERSION}.zip s3://${BUCKET}/macos/
env:
AWS_ACCESS_KEY_ID: ${{ secrets.UPLOAD_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.UPLOAD_KEY }}
BUCKET: ${{ secrets.BUCKET }}
VERSION: ${{ steps.get_version.outputs.VERSION }}
2 changes: 1 addition & 1 deletion .github/workflows/build-tgz-pkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ echo "Build tgz package..."
cd $PKG_ROOT
echo "Version: $VERSION"
tar -czvf "avalanchego-linux-$ARCH-$VERSION.tar.gz" avalanchego-$VERSION
aws s3 cp avalanchego-linux-$ARCH-$VERSION.tar.gz s3://$BUCKET/linux/
aws s3 cp avalanchego-linux-$ARCH-$VERSION.tar.gz s3://$BUCKET/linux/binaries/ubuntu/$RELEASE/$ARCH/
84 changes: 84 additions & 0 deletions .github/workflows/build-ubuntu-amd64-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: build-amd64-debian-packages

on:
push:
tags:
- '*'

jobs:
build-bionic-amd64-package:
runs-on: ubuntu-18.04

steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '1.15.5' # The Go version to download (if necessary) and use.
- run: go version

- name: Build the avalanchego binaries
run: ./scripts/build.sh

- name: Install aws cli
run: |
sudo apt update
sudo apt-get -y install awscli
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
shell: bash

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1

- name: Create debian package
run: ./.github/workflows/build-deb-pkg.sh
env:
TAG: ${{ steps.get_version.outputs.VERSION }}
BUCKET: ${{ secrets.BUCKET }}
ARCH: "amd64"
RELEASE: "bionic"

build-focal-amd64-package:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '1.15.5' # The Go version to download (if necessary) and use.
- run: go version

- name: Build the avalanchego binaries
run: ./scripts/build.sh

- name: Install aws cli
run: |
sudo apt update
sudo apt-get -y install awscli
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
shell: bash

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1

- name: Create debian package
run: ./.github/workflows/build-deb-pkg.sh
env:
TAG: ${{ steps.get_version.outputs.VERSION }}
BUCKET: ${{ secrets.BUCKET }}
ARCH: "amd64"
RELEASE: "focal"

Loading

0 comments on commit 95e0bef

Please sign in to comment.