From c7f0b4c2b6fed396d403222320648d3dad60b410 Mon Sep 17 00:00:00 2001 From: Maxence Maireaux Date: Thu, 17 Feb 2022 10:46:43 +0100 Subject: [PATCH] Update CI for GoReleaser Signed-off-by: Maxence Maireaux --- .github/workflows/main.yml | 15 ++------ .github/workflows/pr.yml | 68 ----------------------------------- .github/workflows/pr_open.yml | 15 ++------ .github/workflows/release.yml | 15 ++------ 4 files changed, 9 insertions(+), 104 deletions(-) delete mode 100644 .github/workflows/pr.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7f31c0e20..9120516f6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -27,15 +27,7 @@ jobs: name: 'Build' needs: - build_control - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ windows-latest, ubuntu-latest ] - include: - - os: windows-latest - file: windows - - os: ubuntu-latest - file: default + runs-on: ubuntu-latest steps: - uses: actions/setup-go@v2 with: @@ -59,20 +51,19 @@ jobs: name: control-dist path: cmd/control/ - name: OSXCross for CGO Support - if: matrix.os == 'ubuntu-latest' run: | mkdir ../../osxcross git clone https://github.com/plentico/osxcross-target.git ../../osxcross/target - name: Downgrade libssl - if: matrix.os == 'ubuntu-latest' run: | echo 'deb http://security.ubuntu.com/ubuntu bionic-security main' | sudo tee -a /etc/apt/sources.list sudo apt update && apt-cache policy libssl1.0-dev sudo apt-get install libssl1.0-dev + - run: sudo apt install gcc-mingw-w64 -y - name: Run GoReleaser uses: goreleaser/goreleaser-action@v2 with: version: latest - args: build --parallelism 4 --rm-dist --skip-validate --snapshot --config .github/.goreleaser.${{matrix.file}}.yml + args: build --parallelism 4 --rm-dist --skip-validate --snapshot env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml deleted file mode 100644 index 8403e5d1f..000000000 --- a/.github/workflows/pr.yml +++ /dev/null @@ -1,68 +0,0 @@ -on: - pull_request: - types: [assigned, opened, synchronize, reopened] - -name: Main2 -jobs: - build_control: - name: 'Build Control' - runs-on: ubuntu-latest - steps: - - name: Get latest release of Numary/Control - uses: rez0n/actions-github-release@main - id: control_release - env: - token: ${{ secrets.GITHUB_TOKEN }} - repository: "numary/control" - type: "stable" - - run: curl -OL ${{ steps.control_release.outputs.browser_download_url }} - - run: tar -zxvf numary-control-${{ steps.control_release.outputs.release }}.tar.gz - - run: rm -rf numary-control-${{ steps.control_release.outputs.release }}.tar.gz - - uses: actions/upload-artifact@v2 - with: - name: control-dist - path: ./** - build: - name: 'Build' - needs: - - build_control - runs-on: ubuntu-latest - steps: - - uses: actions/setup-go@v2 - with: - go-version: '1.16' - - uses: actions/checkout@v2 - - uses: actions/cache@v2 - with: - path: | - ~/.cache/go-build - ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- - - name: get deps - run: go get - env: - CGO_ENABLED: 1 - - name: fetch numary control - uses: actions/download-artifact@v2 - with: - name: control-dist - path: cmd/control/ - - name: OSXCross for CGO Support - run: | - mkdir ../../osxcross - git clone https://github.com/plentico/osxcross-target.git ../../osxcross/target - - name: Downgrade libssl - run: | - echo 'deb http://security.ubuntu.com/ubuntu bionic-security main' | sudo tee -a /etc/apt/sources.list - sudo apt update && apt-cache policy libssl1.0-dev - sudo apt-get install libssl1.0-dev - - run: sudo apt install gcc-mingw-w64 -y - - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v2 - with: - version: latest - args: build --parallelism 4 --rm-dist --skip-validate --snapshot - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/pr_open.yml b/.github/workflows/pr_open.yml index 001e45f03..f5d71b90d 100644 --- a/.github/workflows/pr_open.yml +++ b/.github/workflows/pr_open.yml @@ -123,15 +123,7 @@ jobs: - Test_sqlite - Test_postgres - Lint - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ windows-latest, ubuntu-latest ] - include: - - os: windows-latest - file: windows - - os: ubuntu-latest - file: default + runs-on: ubuntu-latest steps: - uses: actions/setup-go@v2 with: @@ -155,21 +147,20 @@ jobs: name: control-dist path: cmd/control/ - name: OSXCross for CGO Support - if: matrix.os == 'ubuntu-latest' run: | mkdir ../../osxcross git clone https://github.com/plentico/osxcross-target.git ../../osxcross/target - name: Downgrade libssl - if: matrix.os == 'ubuntu-latest' run: | echo 'deb http://security.ubuntu.com/ubuntu bionic-security main' | sudo tee -a /etc/apt/sources.list sudo apt update && apt-cache policy libssl1.0-dev sudo apt-get install libssl1.0-dev + - run: sudo apt install gcc-mingw-w64 -y - name: Run GoReleaser uses: goreleaser/goreleaser-action@v2 with: version: latest - args: build --parallelism 4 --rm-dist --skip-validate --snapshot --config .github/.goreleaser.${{matrix.file}}.yml + args: build --parallelism 4 --rm-dist --skip-validate --snapshot env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - uses: actions/upload-artifact@v2 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cb33de771..fdac99285 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,15 +27,7 @@ jobs: name: 'Build Binary' needs: - build_control - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ windows-latest, ubuntu-latest ] - include: - - os: windows-latest - file: windows - - os: ubuntu-latest - file: default + runs-on: ubuntu-latest steps: - uses: actions/setup-go@v2 with: @@ -55,16 +47,15 @@ jobs: name: control-dist path: cmd/control/ - name: OSXCross for CGO Support - if: matrix.os == 'ubuntu-latest' run: | mkdir ../../osxcross git clone https://github.com/plentico/osxcross-target.git ../../osxcross/target - name: Downgrade libssl - if: matrix.os == 'ubuntu-latest' run: | echo 'deb http://security.ubuntu.com/ubuntu bionic-security main' | sudo tee -a /etc/apt/sources.list sudo apt update && apt-cache policy libssl1.0-dev sudo apt-get install libssl1.0-dev + - run: sudo apt install gcc-mingw-w64 -y - name: Run GoReleaser env: GITHUB_TOKEN: ${{ secrets.NUMARY_GITHUB_TOKEN }} @@ -72,7 +63,7 @@ jobs: uses: goreleaser/goreleaser-action@v2 with: version: latest - args: release --parallelism 4 --rm-dist --skip-validate --config .github/.goreleaser.${{matrix.file}}.yml + args: release --parallelism 4 --rm-dist --skip-validate build_docker: name: 'Build & Publish Docker' runs-on: ubuntu-latest