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

Create dockerized releases #54

Merged
merged 6 commits into from
Oct 15, 2024
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
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@ updates:
directory: /
schedule:
interval: weekly
- package-ecosystem: docker
directory: /
schedule:
interval: weekly
36 changes: 35 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,50 @@ jobs:
path: build/lane-*.tar.*
if-no-files-found: error

create-release:
create-containerized-release:
name: Create Containerized Release
needs:
- version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker/metadata-action@v5
id: meta
with:
images: ghcr.io/codereaper/lane
tags: |
type=semver,pattern={{version}},value=v${{ needs.version.outputs.version }}
type=semver,pattern={{major}}.{{minor}},value=v${{ needs.version.outputs.version }}
type=semver,pattern={{major}},value=v${{ needs.version.outputs.version }}
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- uses: docker/build-push-action@v6
with:
build-args: VERSION=${{ needs.version.outputs.version }}
context: .
platforms: ${{ github.event_name == 'release' && 'linux/arm64,linux/amd64' || '' }}
push: ${{ github.event_name == 'release' && 'true' || 'false' }}
load: ${{ github.event_name == 'release' && 'false' || 'true' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

upload-artifacts:
name: Create Release
needs:
- version
- create-artifacts
- create-containerized-release
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
pattern: release-artifacts-*
merge-multiple: true
path: artifacts

Expand Down
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM golang:alpine AS build
COPY . .
ARG VERSION
RUN go build -trimpath -o /app/ \
-ldflags "-s -w -X github.com/codereaper/lane/cmd.versionString=$VERSION"

FROM scratch
COPY --from=build /app/lane /
ENTRYPOINT [ "/lane" ]
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ Alternatively this tool can be run directly:
go run github.com/codereaper/lane@1.0.0
```

## Containerized

You can run lane using docker by running:
```sh
docker run -it --rm ghcr.io/codereaper/lane
```

## Completion

You can set up auto completion by adding the following to your dot rc file:
Expand Down