Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Support arm/v7 and arm64 and migrate to GitHub Container Registry #102

Merged
merged 13 commits into from
Dec 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ LICENSE
*.yaml
*.yml
*.cov
Dockerfile*
.goreleaser.yaml
.golangci.yml
File renamed without changes.
48 changes: 48 additions & 0 deletions .github/workflows/nightly.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
##
## This GitHub Action is used to release a nightly release of Furiko.
##
## The Action is only used to push new container images with the tag format "nightly",
## and will be performed whenever the main branch is pushed.
##
## Because GoReleaser Pro is required for nightly release support, and to avoid unnecessary complexity,
## a simple shell script is used instead. See ./hack/release-nightly.sh for more information.
##

name: Perform a nightly release

on:
push:
branches:
- main
workflow_dispatch:

jobs:
nightly:
# For now, only a single platform image will be built and pushed for nightly.
# TODO(irvinlim): Use docker manifest to support multi-arch nightly images.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Determine Go version from go.mod
run: echo "GO_VERSION=$(grep "go 1." go.mod | cut -d " " -f 2)" >> $GITHUB_ENV
- uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Perform nightly release
run: make release-nightly
65 changes: 65 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
##
## This GitHub Action is used to release a new version of Furiko.
##
## The Action is run whenever a new tag is pushed, and will perform the following:
##
## - Build artifacts for each platform
## - Create a GitHub Release
## - Push new container image tags
##
## The release process is currently done with GoReleaser: https://goreleaser.com/
##

name: Release new version

on:
push:
tags:
- '*'
workflow_dispatch:

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Determine Go version from go.mod
run: echo "GO_VERSION=$(grep "go 1." go.mod | cut -d " " -f 2)" >> $GITHUB_ENV
- uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
- name: Set up Docker Buildx
id: docker-buildx
uses: docker/setup-buildx-action@v2
with:
platforms: |
linux/amd64
linux/arm
linux/arm64
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Run goreleaser
uses: goreleaser/goreleaser-action@v2
with:
distribution: goreleaser
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# NOTE(irvinlim): If we don't specify this, then GoReleaser uses the "default" buildx
# instance with --builder=default, which doesn't add other architectures by default.
# We will pass this to the `docker buildx --builder=` command in GoReleaser.
DOCKER_BUILDX_INSTANCE: ${{ steps.docker-buildx.outputs.name }}
48 changes: 0 additions & 48 deletions .github/workflows/release.yml

This file was deleted.

38 changes: 0 additions & 38 deletions .github/workflows/snapshot.yml

This file was deleted.

Loading