Skip to content

Commit

Permalink
feat: first stable release
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomio committed Apr 25, 2022
1 parent 866d6f4 commit f5b1d0f
Show file tree
Hide file tree
Showing 22 changed files with 1,365 additions and 239 deletions.
27 changes: 27 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"projectName": "website-screenshot",
"projectOwner": "devtomio",
"repoType": "github",
"repoHost": "https://github.com",
"files": [
"README.md"
],
"imageSize": 100,
"commit": false,
"commitConvention": "angular",
"contributors": [
{
"login": "devtomio",
"name": "Tomio",
"avatar_url": "https://avatars.githubusercontent.com/u/75403863?v=4",
"profile": "https://tomio.codes/",
"contributions": [
"code",
"doc",
"infra",
"maintenance"
]
}
],
"contributorsPerLine": 7
}
32 changes: 31 additions & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,32 @@
[build]
rustflags = ["-Clink-arg=-fuse-ld=lld"]
rustc-wrapper = 'C:\Users\Jezzu\.cargo\bin\sccache.exe'
[target.x86_64-unknown-linux-gnu]
rustflags = [
'-Clink-arg=-fuse-ld=lld',
'-Zshare-generics=y',
]
linker = '/usr/bin/clang'

[target.x86_64-pc-windows-msvc]
rustflags = ['-Zshare-generics=y']
linker = 'rust-lld.exe'

[target.x86_64-apple-darwin]
rustflags = [
'-C',
'link-arg=-fuse-ld=/usr/local/bin/zld',
'-Zshare-generics=y',
'-Csplit-debuginfo=unpacked',
]
[profile.dev]
opt-level = 0
debug = 2
incremental = true
codegen-units = 512

[profile.release]
opt-level = 3
debug = 0
incremental = false
codegen-units = 256
split-debuginfo = '...'
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @devtomio
5 changes: 5 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["config:base", "helpers:pinGitHubActionDigests", "group:allNonMajor"],
"labels": ["Meta: Dependencies"]
}
182 changes: 182 additions & 0 deletions .github/workflows/continuous-delivery.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
name: Continuous Delivery

on:
push:
branches:
- main

jobs:
release_please:
name: Release Please
runs-on: ubuntu-latest
if: github.repository == 'devtomio/website-screenshot'
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
steps:
- uses: google-github-actions/release-please-action@v3
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: rust

github_build:
name: Build release binaries
needs: release_please
if: ${{ needs.release_please.outputs.release_created == 'true' }}
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
name: website-screenshot-x86_64-unknown-linux-gnu.tar.gz

- target: x86_64-unknown-linux-musl
os: ubuntu-latest
name: website-screenshot-x86_64-unknown-linux-musl.tar.gz

- target: i686-unknown-linux-musl
os: ubuntu-latest
name: website-screenshot-i686-unknown-linux-musl.tar.gz

- target: aarch64-unknown-linux-musl
os: ubuntu-latest
name: website-screenshot-aarch64-unknown-linux-musl.tar.gz

- target: arm-unknown-linux-musleabihf
os: ubuntu-latest
name: website-screenshot-arm-unknown-linux-musleabihf.tar.gz

- target: x86_64-apple-darwin
os: macOS-11
name: website-screenshot-x86_64-apple-darwin.tar.gz

- target: aarch64-apple-darwin
os: macOS-11
name: website-screenshot-aarch64-apple-darwin.tar.gz

- target: x86_64-pc-windows-msvc
os: windows-latest
name: website-screenshot-x86_64-pc-windows-msvc.zip

- target: i686-pc-windows-msvc
os: windows-latest
name: website-screenshot-i686-pc-windows-msvc.zip

- target: aarch64-pc-windows-msvc
os: windows-latest
name: website-screenshot-aarch64-pc-windows-msvc.zip

- target: x86_64-unknown-freebsd
os: ubuntu-latest
name: website-screenshot-x86_64-unknown-freebsd.tar.gz

runs-on: ${{ matrix.os }}
continue-on-error: true
steps:
- name: Setup | Checkout
uses: actions/checkout@v3

- name: Setup | Rust
uses: actions-rs/toolchain@v1.0.7
with:
toolchain: stable
override: true
profile: minimal
target: ${{ matrix.target }}

- name: Build | Build
uses: actions-rs/cargo@v1.0.3
with:
command: build
args: --release --locked --target ${{ matrix.target }}
use-cross: ${{ matrix.os == 'ubuntu-latest' }}

- name: Post Build | Prepare artifacts [Windows]
if: matrix.os == 'windows-latest'
run: |
cd target/${{ matrix.target }}/release
strip website-screenshot.exe
7z a ../../../${{ matrix.name }} website-screenshot.exe
cd -
- name: Post Build | Prepare artifacts [-nix]
if: matrix.os != 'windows-latest'
run: |
cd target/${{ matrix.target }}/release
strip website-screenshot || true
tar czvf ../../../${{ matrix.name }} website-screenshot
cd -
- name: Deploy | Upload artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.name }}
path: ${{ matrix.name }}

upload_artifacts:
name: Add Build Artifacts to Release
needs: [release_please, github_build]
runs-on: ubuntu-latest
steps:
- name: Setup | Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup | Artifacts
uses: actions/download-artifact@v3

- name: Setup | Checksums
run: for file in website-screenshot-*/website-screenshot-*; do openssl dgst -sha256 -r "$file" | awk '{print $1}' > "${file}.sha256"; done

- name: Build | Add Artifacts to Release
uses: softprops/action-gh-release@v1
with:
files: website-screenshot-*/website-screenshot-*
tag_name: ${{ needs.release_please.outputs.tag_name }}

cargo_publish:
name: Publish Cargo Package
runs-on: ubuntu-latest
needs: release_please
if: ${{ needs.release_please.outputs.release_created == 'true' }}
steps:
- name: Setup | Checkout
uses: actions/checkout@v3

- name: Setup | Rust
uses: actions-rs/toolchain@v1.0.7
with:
toolchain: stable
profile: minimal
override: true

- name: Build | Publish
run: cargo publish --token ${{ secrets.CRATES_IO_TOKEN }}

publish_docker:
name: Publish website-screenshot image to container registries
runs-on: ubuntu-latest
steps:
- name: Setup | Checkout
uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # tag=v3

- name: Setup | Docker Buildx
uses: docker/setup-buildx-action@94ab11c41e45d028884a99163086648e898eed25 # renovate: tag=v1.6.0

- name: Build | Login to GitHub Container Registry
uses: docker/login-action@dd4fa0671be5250ee6f50aedf4cb05514abda2c7 # tag=v1.14.1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build | Push Docker Image
uses: docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a # tag=v2.10.0
with:
push: true
context: ./
file: Dockerfile
tags: ghcr.io/devtomio/website-screenshot:latest
71 changes: 71 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Continuous Integration

on:
push:
branches:
- main
pull_request:

jobs:
msrv:
name: MSRV
runs-on: ubuntu-latest
steps:
- name: Setup | Checkout
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # tag=v2

- name: Setup | Rust
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # tag=v1
with:
profile: minimal
toolchain: stable
override: true

- name: Setup | Install cargo-msrv
run: cargo install cargo-msrv --no-default-features

- name: Build | Verify the MSRV
run: cargo msrv verify

fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- name: Setup | Checkout
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # tag=v2

- name: Setup | Rust
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # tag=v1
with:
profile: minimal
toolchain: nightly
override: true

- name: Setup | Install rustfmt
run: rustup component add rustfmt

- name: Build | Lint
uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505 # tag=v1
with:
command: fmt
args: --all -- --check

clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- name: Setup | Checkout
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # tag=v2

- name: Setup | Rust
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # tag=v1
with:
profile: minimal
toolchain: stable
override: true

- name: Setup | Install clippy
run: rustup component add clippy

- name: Build | Clippy
run: cargo clippy -- -D warnings
21 changes: 21 additions & 0 deletions .github/workflows/label-sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Automatic Label Sync

on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:

jobs:
label_sync:
name: Automatic Label Synchronization
runs-on: ubuntu-latest
steps:
- name: Checkout Project
uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # tag=v3
with:
repository: 'sapphiredev/readme'
- name: Run Label Sync
uses: crazy-max/ghaction-github-labeler@52525cb66833763f651fc34e244e4f73b6e07ff5 # renovate: tag=v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
yaml-file: .github/labels.yml
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,13 @@
# These are backup files generated by rustfmt
**/*.rs.bk

# Fleet Config
.cargo/config.toml
fleet.toml

# Static Files
/screenshots/
screenshots/*
!screenshots/abcdefghijk.png

# Sled
.website-screenshot/
5 changes: 5 additions & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"MD036": false,
"MD013": false,
"MD024": false
}
Loading

0 comments on commit f5b1d0f

Please sign in to comment.