Test bucket creation #24
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build packages | |
# Big chunk of the build process logic is in the mage build targets | |
on: | |
workflow_call: | |
push: | |
branches: [master, ci-migration] | |
tags: | |
env: | |
GITHUB_OWNER: mysteriumnetwork | |
GITHUB_REPO: node | |
GITHUB_SNAPSHOT_REPO: node-builds | |
GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
jobs: | |
setup-env: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
fetch-tags: true | |
- name: Prepare environment | |
run: | | |
RELEASE_BUILD=false | |
if [[ "${GITHUB_REF}" == /refs/tags/* ]]; then RELEASE_BUILD=true; fi | |
RC_BUILD=false | |
if [[ "${GITHUB_REF}" == /refs/tags/*-rc ]]; then RC_BUILD=true; fi | |
SNAPSHOT_BUILD=false | |
if [[ "${GITHUB_REF}" == "refs/heads/master" ]]; then SNAPSHOT_BUILD=true; fi | |
PR_BUILD=false | |
if [[ "${SNAPSHOT_BUILD}" == "false" && "${RELEASE_BUILD}" == "false" ]]; then PR_BUILD=true; fi | |
BUILD_NUMBER="${{ github.run_id }}"-ghactions | |
if [[ "${RELEASE_BUILD}" == "true" ]]; then | |
BUILD_VERSION="${GITHUB_REF#/refs/tags/}"; | |
elif [[ "${SNAPSHOT_BUILD}" == "true" ]]; then | |
BUILD_VERSION="$(git describe --abbrev=0 --tags)"-1snapshot-"$(date '+%Y%m%dT%H%M')"-"$(echo ${GITHUB_SHA} | cut -c1-8)"; | |
elif [[ "${PR_BUILD}" == "true" ]]; then | |
BRANCH="${GITHUB_HEAD_REF////-}" | |
if [[ "${BRANCH}" == "" ]]; then BRANCH="${GITHUB_REF_NAME}"; fi | |
BUILD_VERSION="$(git describe --abbrev=0 --tags)"-1branch-"${BRANCH}"; | |
fi | |
cat <<EOT >> env.sh | |
export RELEASE_BUILD=$RELEASE_BUILD; | |
export RC_BUILD=$RC_BUILD; | |
export SNAPSHOT_BUILD=$SNAPSHOT_BUILD; | |
export BUILD_NUMBER=$BUILD_NUMBER; | |
export BUILD_VERSION=$BUILD_VERSION; | |
EOT | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: env.sh | |
path: env.sh | |
build-packages: | |
runs-on: ubuntu-latest | |
needs: [setup-env] | |
strategy: | |
max-parallel: 4 | |
matrix: | |
platform: | |
# - PackageLinuxRaspberryImage | |
- PackageLinuxAmd64 | |
# - PackageLinuxArm | |
# - PackageLinuxDebianAmd64 | |
# - PackageLinuxDebianArm64 | |
# - PackageLinuxDebianArm | |
# - PackageMacOSAmd64 | |
# - PackageMacOSArm64 | |
# - PackageWindowsAmd64 | |
# - PackageAndroid | |
# - PackageAndroidProvider | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '1.21.x' | |
- uses: actions/download-artifact@v4 | |
with: | |
name: env.sh | |
- name: Create bucket | |
if: | | |
contains(github.ref, 'refs/tags') || | |
github.ref == 'refs/heads/master' || | |
github.ref == 'refs/heads/ci-migration' | |
env: | |
AWS_EC2_METADATA_DISABLED: true | |
run: | | |
source env.sh | |
go run mage.go -v MakeBucket | |
- name: Setup FPM | |
run: | | |
sudo apt-get install ruby-dev build-essential | |
sudo gem i fpm -f | |
- name: Build package | |
run: | | |
source env.sh | |
unset CI # workaround for "PackageAndroid" target | |
sudo -E go run mage.go -v ${{ matrix.platform }} | |
build-swagger: | |
runs-on: ubuntu-latest | |
needs: [setup-env, build-packages] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '1.21.x' | |
- uses: actions/download-artifact@v4 | |
with: | |
name: env.sh | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build docker | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
run: | | |
source env.sh | |
go run mage.go -v PackageDockerSwaggerRedoc |