From b602c9d3a0628719eaa3d157b3f726af4fbb54ac Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Fri, 3 Dec 2021 11:41:15 +0300 Subject: [PATCH 1/3] .github: upload binaries for Build workflows --- .github/workflows/build.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 27d4f338f..73da5c67a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -40,6 +40,13 @@ jobs: - name: Build CLI run: make build + - name: Upload artifact + uses: actions/upload-artifact@v2 + with: + name: neo-go-binaries-ubuntu + path: ./bin/neo-go + if-no-files-found: error + build_cli_wsc: name: Build CLI (Windows Server Core) runs-on: windows-2022 @@ -66,6 +73,13 @@ jobs: - name: Build CLI run: make build + - name: Upload artifact + uses: actions/upload-artifact@v2 + with: + name: neo-go-binaries-wsc + path: ./bin/neo-go.exe + if-no-files-found: error + build_image_ubuntu: needs: build_cli_ubuntu name: Build Docker image (Ubuntu) From 4a410f4898bc0b5cfa6ed2ad2fbba83995365101 Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Fri, 3 Dec 2021 12:22:48 +0300 Subject: [PATCH 2/3] .github: allow to trigger Build workflow manually --- .github/workflows/build.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 73da5c67a..d85936fdd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,6 +9,11 @@ on: - 'scripts/**' - '**/*.md' workflow_dispatch: + inputs: + ref: + description: 'Ref to build CLI for Ubuntu and Windows Server Core [default: latest master; examples: v0.92.0, 0a4ff9d3e4a9ab432fd5812eb18c98e03b5a7432]' + required: false + default: '' env: GO111MODULE: "on" @@ -21,6 +26,8 @@ jobs: steps: - uses: actions/checkout@v2 with: + ref: ${{ github.event.inputs.ref }} + # Allows to fetch all history for all branches and tags. Need this for proper versioning. fetch-depth: 0 - name: Set up Go @@ -54,6 +61,7 @@ jobs: steps: - uses: actions/checkout@v2 with: + ref: ${{ github.event.inputs.ref }} fetch-depth: 0 - name: Set up Go @@ -88,6 +96,7 @@ jobs: steps: - uses: actions/checkout@v2 with: + ref: ${{ github.event.inputs.ref }} fetch-depth: 0 - name: Build Docker image @@ -101,6 +110,7 @@ jobs: steps: - uses: actions/checkout@v2 with: + ref: ${{ github.event.inputs.ref }} fetch-depth: 0 - name: Build Docker image From 70d00a6f985bc81ee45d6fb5cfd625a9cc97920a Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Fri, 3 Dec 2021 12:25:10 +0300 Subject: [PATCH 3/3] .github: simplify checkout process We don't need separate steps for manual and automatic checkout, the default ref value can be habdled by checkout@v2 itself. --- .github/workflows/publish_to_dockerhub.yml | 44 ++-------------------- 1 file changed, 4 insertions(+), 40 deletions(-) diff --git a/.github/workflows/publish_to_dockerhub.yml b/.github/workflows/publish_to_dockerhub.yml index 8e3b5e7fa..fa634ea63 100644 --- a/.github/workflows/publish_to_dockerhub.yml +++ b/.github/workflows/publish_to_dockerhub.yml @@ -34,21 +34,12 @@ jobs: runs-on: ubuntu-20.04 steps: - - name: Checkout (manual run) - if: ${{ github.event_name == 'workflow_dispatch' }} - uses: actions/checkout@v2 + - uses: actions/checkout@v2 with: ref: ${{ github.event.inputs.ref }} # Allows to fetch all history for all branches and tags. Need this for proper versioning. fetch-depth: 0 - - name: Checkout (automatical run) - if: ${{ github.event_name != 'workflow_dispatch' }} - uses: actions/checkout@v2 - with: - # Allows to fetch all history for all branches and tags. Need this for proper versioning. - fetch-depth: 0 - - name: Sync VM submodule run: | git submodule sync @@ -76,21 +67,12 @@ jobs: name: Publish Ubuntu-based image to DockerHub runs-on: ubuntu-20.04 steps: - - name: Checkout (manual run) - if: ${{ github.event_name == 'workflow_dispatch' }} - uses: actions/checkout@v2 + - uses: actions/checkout@v2 with: ref: ${{ github.event.inputs.ref }} # Allows to fetch all history for all branches and tags. Need this for proper versioning. fetch-depth: 0 - - name: Checkout (automatical run) - if: ${{ github.event_name != 'workflow_dispatch' }} - uses: actions/checkout@v2 - with: - # Allows to fetch all history for all branches and tags. Need this for proper versioning. - fetch-depth: 0 - - name: Build image run: make image @@ -117,21 +99,12 @@ jobs: runs-on: windows-2022 steps: - - name: Checkout (manual run) - if: ${{ github.event_name == 'workflow_dispatch' }} - uses: actions/checkout@v2 + - uses: actions/checkout@v2 with: ref: ${{ github.event.inputs.ref }} # Allows to fetch all history for all branches and tags. Need this for proper versioning. fetch-depth: 0 - - name: Checkout (automatical run) - if: ${{ github.event_name != 'workflow_dispatch' }} - uses: actions/checkout@v2 - with: - # Allows to fetch all history for all branches and tags. Need this for proper versioning. - fetch-depth: 0 - - name: Sync VM submodule run: | git submodule sync @@ -162,21 +135,12 @@ jobs: name: Publish WindowsServerCore-based image to DockerHub runs-on: windows-2022 steps: - - name: Checkout (manual run) - if: ${{ github.event_name == 'workflow_dispatch' }} - uses: actions/checkout@v2 + - uses: actions/checkout@v2 with: ref: ${{ github.event.inputs.ref }} # Allows to fetch all history for all branches and tags. Need this for proper versioning. fetch-depth: 0 - - name: Checkout (automatical run) - if: ${{ github.event_name != 'workflow_dispatch' }} - uses: actions/checkout@v2 - with: - # Allows to fetch all history for all branches and tags. Need this for proper versioning. - fetch-depth: 0 - - name: Build image run: make image-wsc