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

refactor: migrate to axum #21

Merged
merged 12 commits into from
Nov 29, 2023
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
36 changes: 28 additions & 8 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ on:
push:
branches:
- main
tags:
- '*'
pull_request:
branches:
- main

jobs:
lints:
name: Format & Lint
Expand All @@ -15,6 +18,11 @@ jobs:
- name: Checkout sources
uses: actions/checkout@v3

- uses: Swatinem/rust-cache@v2
with:
cache-all-crates: "true"
key: "lints"

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
Expand Down Expand Up @@ -42,15 +50,18 @@ jobs:
arch-matrix:
needs: [lints]
runs-on: ubuntu-latest
env:
CROSS_CONFIG: Cross.toml
strategy:
matrix:
target: [ "armv7-unknown-linux-musleabihf", "x86_64-unknown-linux-musl", "aarch64-unknown-linux-musl" ]
steps:
- name: Checkout sources
uses: actions/checkout@v3

- uses: Swatinem/rust-cache@v2
with:
cache-all-crates: "true"
key: "${{ matrix.os }}-${{ matrix.target }}"

- uses: actions-rs/toolchain@v1
with:
profile: minimal
Expand Down Expand Up @@ -81,11 +92,12 @@ jobs:
with:
version: latest

- name: Docker Hub login
uses: docker/login-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Checkout sources
uses: actions/checkout@v3
Expand All @@ -107,8 +119,16 @@ jobs:
chmod +x -R target/x86_64-unknown-linux-musl/release
working-directory: ./

- name: Update multi-arch container latest
- if: ${{ github.ref_type == 'tag' }}
name: Update multi-arch container latest
run: |
docker buildx build \
--push --platform linux/amd64,linux/arm/v7,linux/arm64/v8 \
-t ghcr.io/cocogitto/cocogitto-bot:${{ github.ref_name }} .

- if: ${{ github.ref_type == 'branch' }}
name: Update multi-arch container latest
run: |
docker buildx build \
--push --platform linux/amd64,linux/arm/v7,linux/arm64/v8 \
. -t oknozor/cocogitto_github_app:latest
-t ghcr.io/cocogitto/cocogitto-bot:latest .
46 changes: 46 additions & 0 deletions .github/workflows/Release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Release

on:
workflow_dispatch:

jobs:
release:
name: SemVer release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- run: |
git config user.name github-actions
git config user.email github-actions@github.com
git config --global user.email github-actions@github.com
git config --global user.name github-actions

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable

- run:
cargo install cargo-edit

- name: SemVer release
id: release
uses: cocogitto/cocogitto-action@v3.5
with:
check-latest-tag-only: true
release: true
git-user: 'github-actions'
git-user-email: 'github-actions@github.com'

- name: Generate Changelog
run: cog changelog --at ${{ steps.release.outputs.version }} -t full_hash > GITHUB_CHANGELOG.md

- name: Upload github release
uses: softprops/action-gh-release@v1
with:
body_path: GITHUB_CHANGELOG.md
tag_name: ${{ steps.release.outputs.version }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
.idea
.private_key
.cargo/
config.toml
Loading
Loading