From 949e46fccaa880d37ee7dd43fe8e8551858c1595 Mon Sep 17 00:00:00 2001 From: Quinn Date: Thu, 17 Aug 2023 10:58:59 -0500 Subject: [PATCH] Update golang to v1.20.7 (#25) * Update golang to v1.20.7 --------- Co-authored-by: Nathaniel van Diepen --- .github/workflows/build.yml | 35 ++++++++++++++++++++--------------- .github/workflows/pr.yml | 31 ++++++++++++++++--------------- .github/workflows/release.yml | 33 +++++++++++++++++++-------------- golang/Dockerfile | 8 ++++---- 4 files changed, 59 insertions(+), 48 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5f6cd82..3d5eed4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,18 +1,23 @@ name: build on: - push: - branches: - - v1.x - - v2.x - - v3.x + push: + branches: + - v1.x + - v2.x + - v3.x jobs: - build: - name: Publish latest - runs-on: ubuntu-latest - steps: - - name: Checkout the Git repository - uses: actions/checkout@v2 - - name: Build and publish images - run: | - echo "${{ secrets.CR_PAT }}" | docker login ghcr.io -u matteodelabre --password-stdin - ./scripts/build -p . + build: + name: Publish latest + runs-on: ubuntu-latest + steps: + - name: Checkout the Git repository + uses: actions/checkout@v3 + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + repository: ghcr.io + username: matteodelabre + password: ${{ secrets.CR_PAT }} + - name: Build and publish images + run: | + ./scripts/build -p . diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index d0b7172..1c61eee 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -1,18 +1,19 @@ name: pr on: - pull_request: - branches: - - v1.x - - v2.x - - v3.x + pull_request: + branches: + - v1.x + - v2.x + - v3.x jobs: - build: - name: Publish latest - runs-on: ubuntu-latest - steps: - - name: Checkout the Git repository - uses: actions/checkout@v2 - - name: Build images - run: | - echo "${{ secrets.CR_PAT }}" | docker login ghcr.io -u matteodelabre --password-stdin - ./scripts/build . + build: + name: Publish latest + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - name: Checkout the Git repository + uses: actions/checkout@v3 + - name: Build images + run: | + ./scripts/build . diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cac8049..e5c4c5b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,17 +1,22 @@ name: release on: - push: - tags: - - '*' + push: + tags: + - '*' jobs: - release: - name: Publish a release - runs-on: ubuntu-latest - steps: - - name: Checkout the Git repository - uses: actions/checkout@v2 - - name: Build and publish images - run: | - echo "${{ secrets.CR_PAT }}" | docker login ghcr.io -u matteodelabre --password-stdin - version="$(echo "${{ github.ref }}" | cut -d / -f 3)" - ./scripts/build -p . "$version" + release: + name: Publish a release + runs-on: ubuntu-latest + steps: + - name: Checkout the Git repository + uses: actions/checkout@v3 + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + repository: ghcr.io + username: matteodelabre + password: ${{ secrets.CR_PAT }} + - name: Build and publish images + run: | + version="$(echo "${{ github.ref }}" | cut -d / -f 3)" + ./scripts/build -p . "$version" diff --git a/golang/Dockerfile b/golang/Dockerfile index affef6f..7721ce1 100644 --- a/golang/Dockerfile +++ b/golang/Dockerfile @@ -5,11 +5,11 @@ FROM $FROM # Install golang RUN cd /root \ && curl --proto '=https' --tlsv1.2 -sSf \ - https://dl.google.com/go/go1.17.1.linux-amd64.tar.gz \ - -o go1.17.1.linux-amd64.tar.gz \ - && tar -C /usr/local -xzf go1.17.1.linux-amd64.tar.gz \ + https://dl.google.com/go/go1.20.7.linux-amd64.tar.gz \ + -o go1.20.7.linux-amd64.tar.gz \ + && tar -C /usr/local -xzf go1.20.7.linux-amd64.tar.gz \ && mkdir go \ - && rm go1.17.1.linux-amd64.tar.gz + && rm go1.20.7.linux-amd64.tar.gz # Add go binaries to PATH ENV PATH="$PATH:/usr/local/go/bin"