From 82141c408c7fad4994f4dab79e9e0854cdb84909 Mon Sep 17 00:00:00 2001 From: Roy Lee Date: Tue, 6 Jul 2021 18:39:27 -0700 Subject: [PATCH] ci: Update Go toolchain to 1.16 --- .github/workflows/{go.yml => basic-check.yml} | 4 +- .github/workflows/create-release.yml | 52 +++++++++++++++++++ .github/workflows/full-sync-part-1.yml | 34 ++++++++++++ .github/workflows/full-sync-part-2.yml | 36 +++++++++++++ 4 files changed, 124 insertions(+), 2 deletions(-) rename .github/workflows/{go.yml => basic-check.yml} (93%) create mode 100644 .github/workflows/create-release.yml create mode 100644 .github/workflows/full-sync-part-1.yml create mode 100644 .github/workflows/full-sync-part-2.yml diff --git a/.github/workflows/go.yml b/.github/workflows/basic-check.yml similarity index 93% rename from .github/workflows/go.yml rename to .github/workflows/basic-check.yml index 8803194d..2762d73b 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/basic-check.yml @@ -3,10 +3,10 @@ on: [push, pull_request] jobs: build: name: Go CI - runs-on: ubuntu-latest + runs-on: self-hosted strategy: matrix: - go: [1.14, 1.15] + go: [1.16] steps: - name: Set up Go uses: actions/setup-go@v2 diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml new file mode 100644 index 00000000..33528aca --- /dev/null +++ b/.github/workflows/create-release.yml @@ -0,0 +1,52 @@ +name: Create release +on: + workflow_dispatch: + inputs: + note: + description: 'Note' + required: false + default: '' + +jobs: + build: + strategy: + matrix: + go: [1.16] + os: [ubuntu-latest, macos-latest, windows-latest] + runs-on: ${{ matrix.os }} + steps: + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go }} + - name: Checkout source + uses: actions/checkout@v2 + - name: Install coreutils, ICU for macOS + if: matrix.os == 'macos-latest' + run: brew install coreutils icu4c + - name: Build executables + env: + GO111MODULE: "on" + run: go build -trimpath -o artifacts/ --tags use_icu_normalization . + - name: SHA256 sum + run: sha256sum -b artifacts/* > artifacts/lbcd.sha256 + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: lbcd-${{ matrix.os }} + path: artifacts/* + + +# for releases see https://trstringer.com/github-actions-create-release-upload-artifacts/ + +# AWS S3 support: +# - name: Upload to Amazon S3 +# uses: ItsKarma/aws-cli@v1.70.0 +# with: +# args: s3 sync .release s3://my-bucket-name +# env: +# # Make sure to add the secrets in the repo settings page +# # AWS_REGION is set to us-east-1 by default +# AWS_ACCESS_KEY_ID: $ +# AWS_SECRET_ACCESS_KEY: $ +# AWS_REGION: us-east-1 diff --git a/.github/workflows/full-sync-part-1.yml b/.github/workflows/full-sync-part-1.yml new file mode 100644 index 00000000..6a643836 --- /dev/null +++ b/.github/workflows/full-sync-part-1.yml @@ -0,0 +1,34 @@ +name: Full Sync From 0 + +on: + workflow_dispatch: + inputs: + note: + description: 'Note' + required: false + default: '' + +jobs: + build: + name: Go CI + runs-on: self-hosted + strategy: + matrix: + go: [1.16] + steps: + - run: | + echo "Note ${{ github.event.inputs.note }}!" + - name: Setup Go + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go }} + - name: Checkout source + uses: actions/checkout@v2 + - name: Build lbcd + run: go build --tags use_icu_normalization . + - name: Create datadir + run: echo "TEMP_DATA_DIR=$(mktemp -d)" >> $GITHUB_ENV + - name: Run lbcd + run: ./lbcd --datadir=${{env.TEMP_DATA_DIR}}/data --logdir=${{env.TEMP_DATA_DIR}}/logs --connect=127.0.0.1 --norpc + - name: Remove datadir + run: rm -rf ${{env.TEMP_DATA_DIR}} diff --git a/.github/workflows/full-sync-part-2.yml b/.github/workflows/full-sync-part-2.yml new file mode 100644 index 00000000..52a58192 --- /dev/null +++ b/.github/workflows/full-sync-part-2.yml @@ -0,0 +1,36 @@ +name: Full Sync From 814k + +on: + workflow_dispatch: + inputs: + note: + description: 'Note' + required: false + default: '' + +jobs: + build: + name: Go CI + runs-on: self-hosted + strategy: + matrix: + go: [1.16] + steps: + - run: | + echo "Note ${{ github.event.inputs.note }}!" + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go }} + - name: Checkout source + uses: actions/checkout@v2 + - name: Build lbcd + run: go build --tags use_icu_normalization . + - name: Create datadir + run: echo "TEMP_DATA_DIR=$(mktemp -d)" >> $GITHUB_ENV + - name: Copy initial data + run: cp -r /home/lbry/lbcd_814k/* ${{env.TEMP_DATA_DIR}} + - name: Run lbcd + run: ./lbcd --datadir=${{env.TEMP_DATA_DIR}}/data --logdir=${{env.TEMP_DATA_DIR}}/logs --connect=127.0.0.1 --norpc + - name: Remove datadir + run: rm -rf ${{env.TEMP_DATA_DIR}}