Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
phenomenes committed May 13, 2024
0 parents commit 3e743d5
Show file tree
Hide file tree
Showing 23 changed files with 3,332 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.git
.gitignore
.gitlab-ci.yml
.releaserc.json
README.md
target
50 changes: 50 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
on:
push:
paths:
- .github/workflows/ci.yml
- '**.rs'
- '**/Cargo.toml'
- '**/Cargo.lock'
pull_request:
paths:
- .github/workflows/ci.yml
- '**.rs'
- '**/Cargo.toml'
- '**/Cargo.lock'

env:
CARGO_TERM_COLOURS: always

name: continuous integration

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: checkout
uses: actions/checkout@v4

- name: cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: install rust toolchain
run: |
rustup update
rustup component add clippy rustfmt
rustup install nightly
- name: fmt
run: cargo fmt -- --check

- name: clippy
run: cargo clippy

- name: build
run: cargo build
53 changes: 53 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
on:
push:
tags:
- "v*"

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

name: release

jobs:
build-and-publish-image:
name: build and publish image
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: checkout
uses: actions/checkout@v4

- name: login to the registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: get metadata (tags, labels)
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: build and push container image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

# TO-DO: create-release and upload-release-asset are no longer maintained
# we should create our actions
build:
name: create github release
runs-on: ubuntu-latest

steps:
- name: checkout
uses: actions/checkout@v4
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*.tgz
*.swp
scratch.md
target
todo.md
Loading

0 comments on commit 3e743d5

Please sign in to comment.