Skip to content

Commit

Permalink
Merge branch 'main' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
ellie authored Dec 9, 2023
2 parents 56a3412 + de62219 commit 5788913
Show file tree
Hide file tree
Showing 187 changed files with 10,006 additions and 18,411 deletions.
84 changes: 84 additions & 0 deletions .github/DISCUSSION_TEMPLATE/support.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
body:
- type: input
attributes:
label: Operating System
description: What operating system are you using?
placeholder: "Example: macOS Big Sur"
validations:
required: true

- type: input
attributes:
label: Shell
description: What shell are you using?
placeholder: "Example: zsh 5.8.1"
validations:
required: true

- type: dropdown
attributes:
label: Version
description: What version of atuin are you running?
multiple: false
options: # how often will I forget to update this? a lot.
- v17.0.0 (Default)
- v16.0.0
- v15.0.0
- v14.0.1
- v14.0.0
- v13.0.1
- v13.0.0
- v12.0.0
- v11.0.0
- v0.10.0
- v0.9.1
- v0.9.0
- v0.8.1
- v0.8.0
- v0.7.2
- v0.7.1
- v0.7.0
- v0.6.4
- v0.6.3
default: 0
validations:
required: true

- type: checkboxes
attributes:
label: Self hosted
description: Are you self hosting atuin server?
options:
- label: I am self hosting atuin server

- type: checkboxes
attributes:
label: Search the issues
description: Did you search the issues and discussions for your problem?
options:
- label: I checked that someone hasn't already asked about the same issue
required: true

- type: textarea
attributes:
label: Behaviour
description: "Please describe the issue - what you expected to happen, what actually happened"

- type: textarea
attributes:
label: Logs
description: "If possible, please include logs from atuin, especially if you self host the server - ATUIN_LOG=debug"

- type: textarea
attributes:
label: Extra information
description: "Anything else you'd like to add?"

- type: checkboxes
attributes:
label: Code of Conduct
description: The Code of Conduct helps create a safe space for everyone. We require
that everyone agrees to it.
options:
- label: I agree to follow this project's [Code of Conduct](https://github.com/atuinsh/atuin/blob/main/CODE_OF_CONDUCT.md)
required: true
32 changes: 32 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: Bug report
about: Unless you are absolutely certain this is a bug, please open a post on the support forum first.
title: ''
labels: bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. ...

**Expected behavior**
A clear and concise description of what you expected to happen.

**Error logs**
Please try and provide error logs where possible

**Device (please complete the following information):**
- OS: [e.g. macOS]
- Shell [bash/zsh/fish/nu]
- Version [e.g. 16.0.0]

**Self hosted**
If you are self hosting Atuin server, please detail your setup here. What version are you using, and how is it deployed?

**Additional context**
Add any other context about the problem here.
10 changes: 10 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# I think this was a little aggressive, but maybe enable if
# people ignore this.
# blank_issues_enabled: false
contact_links:
- name: Support
url: https://github.com/atuinsh/atuin/discussions/new?category=support
about: Get community help and support with Atuin here!
- name: Feature suggestion
url: https://github.com/atuinsh/atuin/discussions/new?category=ideas
about: Suggest an idea for Atuin
4 changes: 2 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ updates:
- package-ecosystem: "cargo" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "daily"
interval: "weekly"
- package-ecosystem: "docker" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "daily"
interval: "weekly"
161 changes: 120 additions & 41 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
@@ -1,63 +1,142 @@
name: Build docker image
name: build-docker

on:
push:
branches:
- 'main'
tags:
- 'v*'

permissions:
packages: write
branches: [ main ]

jobs:
build:
name: build and publish atuin image

publish_x86:
concurrency:
group: ${{ github.ref }}-x86
cancel-in-progress: true
permissions:
packages: write

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
repository: atuinsh/atuin
path: "./"

- name: Setup mirror
uses: self-actuated/hub-mirror@master

- name: Check Out Repo
uses: actions/checkout@v3
- name: Get Repo Owner
id: get_repo_owner
run: echo "REPO_OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" > $GITHUB_ENV

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to container Registry
uses: docker/login-action@v2
with:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Get short sha
id: shortsha
run: echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT

- name: Docker meta
id: meta
uses: docker/metadata-action@v4
- name: Release build
id: release_build
uses: docker/build-push-action@v4
with:
images: ghcr.io/${{ github.repository }}
outputs: "type=registry,push=true"
platforms: linux/amd64
file: ./Dockerfile
context: .
provenance: false
build-args: |
Version=dev
GitCommit=${{ steps.shortsha.outputs.short_sha }}
tags: |
type=ref,event=pr
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
ghcr.io/${{ env.REPO_OWNER }}/atuin:${{ steps.shortsha.outputs.short_sha }}-amd64
publish_aarch64:
concurrency:
group: ${{ github.ref }}-aarch64
cancel-in-progress: true
permissions:
packages: write

runs-on: actuated-arm64-4cpu-16gb
steps:
- uses: actions/checkout@master
with:
repository: atuinsh/atuin
path: "./"

- name: Setup mirror
uses: self-actuated/hub-mirror@master

- name: Get Repo Owner
id: get_repo_owner
run: echo "REPO_OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" > $GITHUB_ENV

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2

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

- name: Get short sha
id: shortsha
run: echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT

- name: Build and push
id: docker_build
- name: Release build
id: release_build
uses: docker/build-push-action@v4
with:
context: ./
outputs: "type=registry,push=true"
platforms: linux/arm64
file: ./Dockerfile
builder: ${{ steps.buildx.outputs.name }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64 #,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: RUST_BACKTRACE=1

- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
context: .
provenance: false
build-args: |
Version=dev
GitCommit=${{ steps.shortsha.outputs.short_sha }}
tags: |
ghcr.io/${{ env.REPO_OWNER }}/atuin:${{ steps.shortsha.outputs.short_sha }}-aarch64
publish_manifest:
runs-on: ubuntu-latest
needs: [publish_x86, publish_aarch64]
steps:
- uses: actions/checkout@master
with:
repository: atuinsh/atuin
path: "./"

- name: Get Repo Owner
id: get_repo_owner
run: echo "REPO_OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" > $GITHUB_ENV

- name: Login to container Registry
uses: docker/login-action@v2
with:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io

- name: Get short sha
id: shortsha
run: echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT

- name: Create manifest
run: |
docker manifest create ghcr.io/${{ env.REPO_OWNER }}/atuin:${{ steps.shortsha.outputs.short_sha }} \
--amend ghcr.io/${{ env.REPO_OWNER }}/atuin:${{ steps.shortsha.outputs.short_sha }}-amd64 \
--amend ghcr.io/${{ env.REPO_OWNER }}/atuin:${{ steps.shortsha.outputs.short_sha }}-aarch64
docker manifest annotate --arch amd64 --os linux ghcr.io/${{ env.REPO_OWNER }}/atuin:${{ steps.shortsha.outputs.short_sha }} ghcr.io/${{ env.REPO_OWNER }}/atuin:${{ steps.shortsha.outputs.short_sha }}-amd64
docker manifest annotate --arch arm64 --os linux ghcr.io/${{ env.REPO_OWNER }}/atuin:${{ steps.shortsha.outputs.short_sha }} ghcr.io/${{ env.REPO_OWNER }}/atuin:${{ steps.shortsha.outputs.short_sha }}-aarch64
docker manifest inspect ghcr.io/${{ env.REPO_OWNER }}/atuin:${{ steps.shortsha.outputs.short_sha }}
docker manifest push ghcr.io/${{ env.REPO_OWNER }}/atuin:${{ steps.shortsha.outputs.short_sha }}
2 changes: 1 addition & 1 deletion .github/workflows/nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Run nix flake check
run: nix flake check --print-build-logs

build:
build-test:
runs-on: ubuntu-latest

steps:
Expand Down
19 changes: 14 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- { os: ubuntu-20.04 , target: x86_64-unknown-linux-gnu }
- { os: ubuntu-20.04 , target: aarch64-unknown-linux-gnu }
- { os: macos-12 , target: x86_64-apple-darwin }
- { os: macos-12 , target: aarch64-apple-darwin }
- { os: self-hosted , target: aarch64-apple-darwin }
steps:
- name: Check for release
id: is-release
Expand All @@ -54,7 +54,7 @@ jobs:
run: |
case ${{ matrix.job.target }} in
arm-unknown-linux-gnueabihf) sudo apt-get -y update ; sudo apt-get -y install gcc-arm-linux-gnueabihf ;;
aarch64-unknown-linux-gnu) sudo apt-get -y update ; sudo apt-get -y install gcc-aarch64-linux-gnu ;;
aarch64-unknown-linux-gnu) sudo apt-get -y update ; sudo apt-get -y install gcc-aarch64-linux-gnu qemu-user;;
x86_64-unknown-linux-musl) sudo apt-get -y update ; sudo apt-get -y install musl-tools ;;
esac
Expand Down Expand Up @@ -85,7 +85,11 @@ jobs:
rustc -V
- name: Build
run: cargo build --locked --release --target=${{ matrix.job.target }}
run: |
case ${{ matrix.job.target }} in
aarch64-unknown-linux-gnu) export RUSTFLAGS="-C linker=aarch64-linux-gnu-gcc";;
esac;
cargo build --locked --release --target=${{ matrix.job.target }}
- name: Strip debug information from executable
id: strip
Expand Down Expand Up @@ -144,9 +148,14 @@ jobs:
# README, LICENSE and CHANGELOG files
cp "README.md" "LICENSE" "$ARCHIVE_DIR"
QEMU_PREFIX=""
case ${{ matrix.job.target }} in
aarch64-unknown-linux-gnu) QEMU_PREFIX="qemu-aarch64 -L /usr/aarch64-linux-gnu" ;;
esac;
# Shell completions
for sh in 'bash' 'fish' 'zsh'; do
"${{ steps.strip.outputs.BIN_PATH }}" gen-completions -s $sh -o "${ARCHIVE_DIR}/completions"
$QEMU_PREFIX "${{ steps.strip.outputs.BIN_PATH }}" gen-completions -s $sh -o "${ARCHIVE_DIR}/completions"
done
# base compressed package
Expand All @@ -172,7 +181,7 @@ jobs:
if: startsWith(matrix.job.os, 'ubuntu')
run: |
cargo install cargo-deb
cargo deb -p atuin
cargo deb --deb-revision="" -p atuin
case ${{ matrix.job.target }} in
aarch64-*-linux-*) DPKG_ARCH=arm64 ;;
Expand Down
Loading

0 comments on commit 5788913

Please sign in to comment.