Skip to content

Commit

Permalink
Release version 0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sorairolake committed Mar 26, 2024
2 parents 5ce9750 + 7b131f0 commit 74b173c
Show file tree
Hide file tree
Showing 109 changed files with 19,764 additions and 0 deletions.
77 changes: 77 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# SPDX-FileCopyrightText: 2024 Shun Sakai
#
# SPDX-License-Identifier: GPL-3.0-or-later

name: 🐞 Bug report
description: Create a report to help us improve
labels: ["bug"]

body:
- type: checkboxes
attributes:
label: Checklist
options:
- label: I have searched the existing issues
required: true

- type: textarea
attributes:
label: Describe the bug
description: A clear and concise description of what the bug is.
validations:
required: true

- type: textarea
attributes:
label: To Reproduce
description: Steps to reproduce the behavior.
validations:
required: false

- type: textarea
attributes:
label: Expected behavior
description: A clear and concise description of what you expected to happen.
validations:
required: true

- type: input
attributes:
label: favico version
description: Output of `favico -V`.
placeholder: 0.1.0
validations:
required: true

- type: input
attributes:
label: Rust version
description: Output of `rustc -V`.
placeholder: 1.56.0
validations:
required: true

- type: textarea
attributes:
label: Environment
description: Tell us where on the platform it happens.
placeholder: |
- OS: Debian 12
- arch: x86_64
validations:
required: false

- type: textarea
attributes:
label: Additional context
description: Add any other context about the problem here.
validations:
required: false

- type: checkboxes
attributes:
label: Code of Conduct
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/sorairolake/favico/blob/develop/CODE_OF_CONDUCT.md)
options:
- label: I agree to follow this project's Code of Conduct
required: true
37 changes: 37 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# SPDX-FileCopyrightText: 2024 Shun Sakai
#
# SPDX-License-Identifier: GPL-3.0-or-later

name: 💡 Feature request
description: Suggest an idea for this project
labels: ["enhancement"]

body:
- type: checkboxes
attributes:
label: Checklist
options:
- label: I have searched the existing issues
required: true

- type: textarea
attributes:
label: Summary
description: A clear and concise description of what the suggestion is.
validations:
required: true

- type: textarea
attributes:
label: Additional context
description: Add any other context about the feature request here.
validations:
required: false

- type: checkboxes
attributes:
label: Code of Conduct
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/sorairolake/favico/blob/develop/CODE_OF_CONDUCT.md)
options:
- label: I agree to follow this project's Code of Conduct
required: true
22 changes: 22 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# SPDX-FileCopyrightText: 2024 Shun Sakai
#
# SPDX-License-Identifier: GPL-3.0-or-later

version: 2
updates:
- package-ecosystem: "cargo"
directory: "/"
schedule:
interval: "daily"
open-pull-requests-limit: 15

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
open-pull-requests-limit: 15

- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "daily"
22 changes: 22 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
## Description

<!-- Describe your changes in detail. -->

<!--
If it resolves an open issue, link to the issue here, otherwise remove this
line.
-->

Closes #

## Additional context

<!-- If you have any other context, describe them here. -->

## Checklist

- [ ] I have read the [Contribution Guide].
- [ ] I agree to follow the [Code of Conduct].

[Contribution Guide]: https://github.com/sorairolake/favico/blob/develop/CONTRIBUTING.adoc
[Code of Conduct]: https://github.com/sorairolake/favico/blob/develop/CODE_OF_CONDUCT.md
3 changes: 3 additions & 0 deletions .github/pull_request_template.md.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2024 Shun Sakai

SPDX-License-Identifier: GPL-3.0-or-later
140 changes: 140 additions & 0 deletions .github/workflows/CD.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
# SPDX-FileCopyrightText: 2024 Shun Sakai
#
# SPDX-License-Identifier: GPL-3.0-or-later

name: CD

on:
pull_request:
push:
branches:
- "develop"
tags:
- "v[0-9]+.[0-9]+.[0-9]+"

permissions:
contents: write

jobs:
build:
name: Build
runs-on: ${{ matrix.os }}
outputs:
get_version: ${{ steps.get_version.outputs.version-without-v }}
strategy:
matrix:
target:
- aarch64-unknown-linux-musl
- x86_64-unknown-linux-musl
- aarch64-apple-darwin
- x86_64-apple-darwin
- aarch64-pc-windows-msvc
- x86_64-pc-windows-msvc
include:
- target: aarch64-unknown-linux-musl
os: ubuntu-22.04
use-cross: true
- target: x86_64-unknown-linux-musl
os: ubuntu-22.04
use-cross: true
- target: aarch64-apple-darwin
os: macos-12
- target: x86_64-apple-darwin
os: macos-12
- target: aarch64-pc-windows-msvc
os: windows-2022
- target: x86_64-pc-windows-msvc
os: windows-2022
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@v1
with:
toolchain: stable
targets: ${{ matrix.target }}
- name: Install cross
if: ${{ matrix.use-cross }}
uses: taiki-e/install-action@v2.29.8
with:
tool: cross
- name: Cache build artifacts
uses: Swatinem/rust-cache@v2.7.3
with:
key: ${{ matrix.target }}
- name: Setup Ruby
if: matrix.os != 'windows-2022' && !matrix.use-cross
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2
- name: Install Asciidoctor
if: matrix.os != 'windows-2022' && !matrix.use-cross
run: |
gem install asciidoctor
asciidoctor -V
- name: Build a package
if: ${{ !matrix.use-cross }}
run: cargo build --release --target ${{ matrix.target }}
- name: Build a package with cross
if: ${{ matrix.use-cross }}
run: cross build --release --target ${{ matrix.target }}
- name: Get version
id: get_version
uses: battila7/get-version-action@v2.3.0
- name: Create a package
shell: bash
run: |
if [ "${{ matrix.os }}" != "windows-2022" ] ; then
bin="target/${{ matrix.target }}/release/favico"
else
bin="target/${{ matrix.target }}/release/favico.exe"
fi
package="favico-${{ steps.get_version.outputs.version }}-${{ matrix.target }}"
mkdir -p "${package}"/docs
cp README.md "${bin}" "${package}"
cp -r LICENSES "${package}"
cp {AUTHORS,BUILD,CHANGELOG,CONTRIBUTING}.adoc "${package}"/docs
if [ "${{ matrix.os }}" != "windows-2022" ] ; then
mkdir -p "${package}"/man
cp "$(find ./target -path '*/favico-*/out' -type d)"/* "${package}"/man
fi
if [ "${{ matrix.os }}" != "windows-2022" ] ; then
tar -cvf "${package}.tar" "${package}"
zstd --rm -19 -v "${package}.tar"
else
7z a -bb -mx=9 -m0=LZMA "${package}.7z" "${package}"
fi
rm -rv favico-*/
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: "favico-${{ steps.get_version.outputs.version }}-${{ matrix.target }}"
path: "favico-*.*"

release:
name: Release
needs: build
runs-on: ubuntu-22.04
steps:
- name: Download artifact
uses: actions/download-artifact@v4
- name: Calculate checksums
run: |
mv favico-*/* .
rmdir -v favico-*/
sha256sum favico-* | tee sha256sums.txt
b2sum favico-* | tee b2sums.txt
- name: Release
uses: softprops/action-gh-release@v2.0.4
if: startsWith(github.ref, 'refs/tags/')
with:
draft: true
files: |
favico-*
sha256sums.txt
b2sums.txt
name: "Release version ${{ needs.build.outputs.get_version }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
86 changes: 86 additions & 0 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# SPDX-FileCopyrightText: 2024 Shun Sakai
#
# SPDX-License-Identifier: GPL-3.0-or-later

name: CI

on:
pull_request:
push:
branches:
- "develop"
- "master"
schedule:
- cron: "0 0 * * 0"

jobs:
test:
name: Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
target:
- x86_64-unknown-linux-gnu
- x86_64-apple-darwin
- x86_64-pc-windows-msvc
toolchain:
- 1.74.0 # MSRV
- stable
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-22.04
- target: x86_64-apple-darwin
os: macos-12
- target: x86_64-pc-windows-msvc
os: windows-2022
steps:
- name: Set Git to use LF
if: matrix.os == 'windows-2022'
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
targets: ${{ matrix.target }}
- name: Cache build artifacts
uses: Swatinem/rust-cache@v2.7.3
with:
key: ${{ matrix.target }}
- name: Run tests
run: cargo test --target ${{ matrix.target }}

rustfmt:
name: Rustfmt
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@v1
with:
toolchain: stable
components: rustfmt
- name: Cache build artifacts
uses: Swatinem/rust-cache@v2.7.3
- name: Check code formatted
run: cargo fmt -- --check

clippy:
name: Clippy
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@v1
with:
toolchain: stable
components: clippy
- name: Cache build artifacts
uses: Swatinem/rust-cache@v2.7.3
- name: Check no lint warnings
run: cargo clippy -- -D warnings

0 comments on commit 74b173c

Please sign in to comment.