fix(workflows): update actions/setup-go to v2 (#14)

This commit is contained in:
Ryan (hackercat)
2021-06-14 22:30:46 +00:00
committed by GitHub
parent 93fbe6ae61
commit 405652dcda
12 changed files with 282 additions and 172 deletions
+6 -6
View File
@@ -21,7 +21,7 @@ env:
PLATFORMS: linux/amd64,linux/arm64,linux/arm/v7
jobs:
build:
build-alpine:
runs-on: ubuntu-latest
environment: Images
steps:
@@ -81,7 +81,7 @@ jobs:
quay.io/${{ env.SLUG }}:${{ env.TAG }}
docker.io/${{ env.SLUG }}:${{ env.TAG }}
build-args: |
IMAGEOS=${{ env.IMAGE }}
DISTRO=${{ env.IMAGE }}
BUILD_TAG_VERSION=${{ steps.print-tag.outputs.tag }}
BUILD_TAG=act
BUILD_REF=${{ github.sha }}
@@ -101,13 +101,13 @@ jobs:
docker.io/${{ env.SLUG }}:${{ env.TAG }}
build-args: |
IMAGE=ghcr.io/${{ env.SLUG }}
IMAGEOS=${{ env.IMAGE }}
DISTRO=${{ env.IMAGE }}
TAG=act-${{ steps.print-tag.outputs.tag }}
BUILD_TAG_VERSION=${{ steps.print-tag.outputs.tag }}
BUILD_TAG=runner
BUILD_REF=${{ github.sha }}
- uses: actions/setup-go@v1
- uses: actions/setup-go@v2
with:
go-version: 1.16
@@ -139,7 +139,7 @@ jobs:
quay.io/${{ env.SLUG }}:${{ env.TAG }}
docker.io/${{ env.SLUG }}:${{ env.TAG }}
build-args: |
IMAGEOS=${{ env.IMAGE }}
DISTRO=${{ env.IMAGE }}
BUILD_TAG_VERSION=${{ steps.print-tag.outputs.tag }}
BUILD_TAG=${{ env.TAG }}
BUILD_REF=${{ github.sha }}
@@ -159,7 +159,7 @@ jobs:
docker.io/${{ env.SLUG }}:${{ env.TAG }}
build-args: |
IMAGE=ghcr.io/${{ env.SLUG }}
IMAGEOS=${{ env.IMAGE }}
DISTRO=${{ env.IMAGE }}
TAG=act-${{ steps.print-tag.outputs.tag }}
BUILD_TAG_VERSION=${{ steps.print-tag.outputs.tag }}
BUILD_TAG=${{ env.TAG }}
+123 -86
View File
@@ -18,13 +18,21 @@ on:
env:
SLUG: ${{ github.repository_owner }}/ubuntu
IMAGE: ubuntu
PLATFORMS: linux/amd64,linux/arm64
PLATFORMS: linux/amd64
NODE: '12'
BUILD_REF: ${{ github.sha }}
SKIP_TEST: true
defaults:
run:
shell: sh
jobs:
build:
build-base:
runs-on: ubuntu-latest
environment: Images
env:
PLATFORMS: linux/amd64,linux/arm64
strategy:
fail-fast: true
max-parallel: 4
@@ -55,24 +63,21 @@ jobs:
password: ${{ secrets.DOCKER_TOKEN }}
- name: Print tag
id: print-tag
shell: sh
run: |
if ${{ github.event_name == 'pull_request' }} && ${{ !env.ACT }} ; then
echo "::set-output name=tag::PR-${{ github.event.number }}"
echo "PART_TAG=PR-${{ github.event.number }}" >> $GITHUB_ENV
elif ${{ !env.ACT }} ; then
echo "::set-output name=tag::$(date +%Y%m%d)"
echo "PART_TAG=$(date +%Y%m%d)" >> $GITHUB_ENV
else
echo "::set-output name=tag::dev"
echo "PART_TAG=dev" >> $GITHUB_ENV
fi
- name: Set Ubuntu version to RELEASE
id: print-release
run: |
if [ "latest" = "${{ matrix.TAG }}" ]; then
echo "::set-output name=RELEASE::$(lsb_release -rs)"
echo "RELEASE_TAG=$(lsb_release -rs)" >> $GITHUB_ENV
else
echo "::set-output name=RELEASE::${{ matrix.TAG }}"
echo "RELEASE_TAG=${{ matrix.TAG }}" >> $GITHUB_ENV
fi
- name: Set up QEMU
@@ -84,101 +89,133 @@ jobs:
- uses: actions/checkout@v2
- name: Build and push ${{ env.SLUG }}:${{ env.TAG }}
uses: docker/build-push-action@v2
run: ./build.sh
env:
TAG: act-${{ matrix.TAG }}-${{ steps.print-tag.outputs.tag }}
with:
context: .
push: true
file: ./linux/${{ env.IMAGE }}/act/Dockerfile
platforms: ${{ env.PLATFORMS }}
tags: |
ghcr.io/${{ env.SLUG }}:${{ env.TAG }}
quay.io/${{ env.SLUG }}:${{ env.TAG }}
docker.io/${{ env.SLUG }}:${{ env.TAG }}
build-args: |
IMAGEOS=${{ env.IMAGE }}
NODE_VERSION=${{ env.NODE }}
BUILD_TAG_VERSION=${{ steps.print-tag.outputs.tag }}
BUILD_TAG=act-${{ matrix.TAG }}
BUILD_REF=${{ github.sha }}
TAG: act-${{ matrix.TAG }}-${{ env.PART_TAG }}
TYPE: act
FROM_IMAGE: buildpack-deps
FROM_TAG: ${{ env.RELEASE_TAG }}
DISTRO: ${{ env.IMAGE }}
BUILD_TAG_VERSION: ${{ env.PART_TAG }}
BUILD_TAG: act-${{ matrix.TAG }}
- name: Build and push ${{ env.SLUG }}:${{ env.TAG }}
uses: docker/build-push-action@v2
run: ./build.sh
env:
TAG: runner-${{ matrix.TAG }}-${{ steps.print-tag.outputs.tag }}
with:
context: .
push: true
file: ./linux/${{ env.IMAGE }}/runner/Dockerfile
platforms: ${{ env.PLATFORMS }}
tags: |
ghcr.io/${{ env.SLUG }}:${{ env.TAG }}
quay.io/${{ env.SLUG }}:${{ env.TAG }}
docker.io/${{ env.SLUG }}:${{ env.TAG }}
build-args: |
IMAGE=ghcr.io/${{ env.SLUG }}
IMAGEOS=${{ env.IMAGE }}
TAG=act-${{ matrix.TAG }}-${{ steps.print-tag.outputs.tag }}
BUILD_TAG_VERSION=${{ steps.print-tag.outputs.tag }}
BUILD_TAG=runner
BUILD_REF=${{ github.sha }}
TAG: runner-${{ matrix.TAG }}-${{ env.PART_TAG }}
TYPE: runner
DISTRO: ${{ env.IMAGE }}
FROM_IMAGE: ghcr.io/${{ env.SLUG }}
FROM_TAG: act-${{ matrix.TAG }}-${{ env.PART_TAG }}
BUILD_TAG_VERSION: ${{ env.PART_TAG }}
BUILD_TAG: runner-${{ matrix.TAG }}
- uses: actions/setup-go@v1
- uses: actions/setup-go@v2
with:
go-version: 1.16
- uses: actions/checkout@v2
with:
ref: cat/fix/change-image
repository: catthehacker/act-fork
repository: nektos/act
path: act
- env:
ACT_TEST_IMAGE: ghcr.io/${{ env.SLUG }}:act-${{ matrix.TAG }}-${{ steps.print-tag.outputs.tag }}
ACT_REPOSITORY: catthehacker/act-fork
ACT_OWNER: catthehacker
- if: ${{ !env.SKIP_TEST }}
env:
ACT_TEST_IMAGE: ghcr.io/${{ env.SLUG }}:act-${{ matrix.TAG }}-${{ env.PART_TAG }}
run: |
cd act/
go test ./...
- name: Build and push ${{ env.SLUG }}:${{ env.TAG }}
uses: docker/build-push-action@v2
if: ${{ ( github.event_name != 'pull_request' && !env.ACT ) }}
run: ./build.sh
env:
TAG: act
with:
context: .
push: ${{ ( github.event_name != 'pull_request' && !env.ACT ) }}
file: ./linux/${{ env.IMAGE }}/act/Dockerfile
platforms: ${{ env.PLATFORMS }}
tags: |
ghcr.io/${{ env.SLUG }}:${{ env.TAG }}
quay.io/${{ env.SLUG }}:${{ env.TAG }}
docker.io/${{ env.SLUG }}:${{ env.TAG }}
build-args: |
NODE_VERSION=${{ env.NODE }}
IMAGEOS=${{ env.IMAGE }}
BUILD_TAG_VERSION=${{ steps.print-tag.outputs.tag }}
BUILD_TAG=act-${{ matrix.TAG }}
BUILD_REF=${{ github.sha }}
TAG: act-${{ matrix.TAG }}
TYPE: act
FROM_IMAGE: buildpack-deps
FROM_TAG: ${{ env.RELEASE_TAG }}
DISTRO: ${{ env.IMAGE }}
BUILD_TAG_VERSION: ${{ env.PART_TAG }}
BUILD_TAG: act-${{ matrix.TAG }}
- name: Build and push ${{ env.SLUG }}:${{ env.TAG }}
uses: docker/build-push-action@v2
if: ${{ ( github.event_name != 'pull_request' && !env.ACT ) }}
run: ./build.sh
shell: sh
env:
TAG: runner
TAG: runner-${{ matrix.TAG }}
TYPE: runner
DISTRO: ${{ env.IMAGE }}
FROM_IMAGE: ghcr.io/${{ env.SLUG }}
FROM_TAG: act-${{ matrix.TAG }}
BUILD_TAG_VERSION: ${{ env.PART_TAG }}
BUILD_TAG: runner-${{ matrix.TAG }}
build-flavours:
runs-on: ubuntu-latest
needs: [build-base]
strategy:
fail-fast: true
max-parallel: 4
matrix:
TAG: [latest, 20.04, 18.04, 16.04]
TYPE: [js, rust]
steps:
- name: Login to GitHub Container Registry
id: ghcr
uses: docker/login-action@v1
with:
context: .
push: ${{ ( github.event_name != 'pull_request' && !env.ACT ) }}
file: ./linux/${{ env.IMAGE }}/runner/Dockerfile
platforms: ${{ env.PLATFORMS }}
tags: |
ghcr.io/${{ env.SLUG }}:${{ env.TAG }}
quay.io/${{ env.SLUG }}:${{ env.TAG }}
docker.io/${{ env.SLUG }}:${{ env.TAG }}
build-args: |
IMAGE=ghcr.io/${{ env.SLUG }}
IMAGEOS=${{ env.IMAGE }}
TAG=act-${{ matrix.TAG }}-${{ steps.print-tag.outputs.tag }}
BUILD_TAG_VERSION=${{ steps.print-tag.outputs.tag }}
BUILD_TAG=runner-${{ matrix.TAG }}
BUILD_REF=${{ github.sha }}
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to Quay
id: quay
uses: docker/login-action@v1
with:
registry: quay.io
username: ${{ secrets.QUAY_USER }}
password: ${{ secrets.QUAY_TOKEN }}
- name: Login to Docker Hub
id: dckr
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Print tag
run: |
if ${{ github.event_name == 'pull_request' }} && ${{ !env.ACT }} ; then
echo "PART_TAG=PR-${{ github.event.number }}" >> $GITHUB_ENV
elif ${{ !env.ACT }} ; then
echo "PART_TAG=$(date +%Y%m%d)" >> $GITHUB_ENV
else
echo "PART_TAG=dev" >> $GITHUB_ENV
fi
- name: Set Ubuntu version to RELEASE
run: |
if [ "latest" = "${{ matrix.TAG }}" ]; then
echo "RELEASE_TAG=$(lsb_release -rs)" >> $GITHUB_ENV
else
echo "RELEASE_TAG=${{ matrix.TAG }}" >> $GITHUB_ENV
fi
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- uses: actions/checkout@v2
- name: Build and push ${{ env.SLUG }}:${{ env.TAG }}
run: ./build.sh
env:
TAG: ${{ matrix.TYPE }}-${{ matrix.TAG }}-${{ env.PART_TAG }}
TYPE: ${{ matrix.TYPE }}
FROM_IMAGE: ghcr.io/${{ env.SLUG }}
FROM_TAG: act-${{ matrix.TAG }}
DISTRO: ${{ env.IMAGE }}
BUILD_TAG_VERSION: ${{ env.PART_TAG }}
BUILD_TAG: ${{ matrix.TYPE }}-${{ matrix.TAG }}