Skip to content

Commit 7fb48bf

Browse files
committed
Update: Remove Twitter, add Misskey, upgrade deps
1 parent a8b361f commit 7fb48bf

10 files changed

+1601
-1291
lines changed

.github/workflows/build.yaml

+27-12
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ name: build
22

33
on:
44
push:
5+
branches:
6+
- main
57
pull_request:
68

79
jobs:
@@ -11,15 +13,28 @@ jobs:
1113
packages: write
1214
contents: read
1315
steps:
14-
- uses: docker/setup-qemu-action@v1
15-
- uses: docker/setup-buildx-action@v1
16-
- uses: actions/checkout@v2
17-
- name: Build Docker image
18-
run: docker buildx build --platform linux/amd64,linux/arm64/v8 .
19-
- name: Push Docker image
20-
if: github.ref == 'refs/heads/main'
21-
run: |
22-
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
23-
docker buildx build --platform linux/amd64,linux/arm64/v8 . -t ghcr.io/pbzweihander/rust-trending:${{ github.sha }} --push
24-
docker buildx build --platform linux/amd64,linux/arm64/v8 . -t ghcr.io/pbzweihander/rust-trending:latest --push
25-
16+
- uses: docker/setup-qemu-action@v3
17+
- uses: docker/setup-buildx-action@v3
18+
- uses: docker/metadata-action@v5
19+
id: meta
20+
with:
21+
images: |
22+
ghcr.io/${{ github.repository }}
23+
tags: |
24+
type=sha,format=long,prefix=
25+
type=ref,event=pr
26+
flavor: |
27+
latest=true
28+
- uses: docker/login-action@v3
29+
with:
30+
registry: ghcr.io
31+
username: ${{ github.actor }}
32+
password: ${{ secrets.GITHUB_TOKEN }}
33+
- uses: actions/checkout@v4
34+
- uses: docker/build-push-action@v6
35+
with:
36+
push: ${{ github.ref == 'refs/heads/main' }}
37+
cache-to: type=gha
38+
cache-from: type=gha,mode=max
39+
tags: ${{ steps.meta.outputs.tags }}
40+
labels: ${{ steps.meta.outputs.labels }}

.github/workflows/clippy.yaml

+8-12
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,17 @@ name: clippy
22

33
on:
44
push:
5+
branches:
6+
- main
57
pull_request:
68

79
jobs:
810
clippy:
911
runs-on: ubuntu-latest
1012
steps:
11-
- uses: actions/checkout@v2
12-
- uses: actions-rs/toolchain@v1
13-
with:
14-
profile: minimal
15-
toolchain: stable
16-
components: clippy
17-
- uses: Swatinem/rust-cache@v1
18-
- name: Check clippy
19-
uses: actions-rs/clippy-check@v1
20-
with:
21-
token: ${{ secrets.GITHUB_TOKEN }}
22-
args: --no-deps -- -D warnings
13+
- run: |
14+
rustup toolchain install stable --profile minimal --component clippy
15+
- uses: actions/checkout@v4
16+
- uses: Swatinem/rust-cache@v2
17+
- run: |
18+
cargo clippy --no-deps -- -D warnings

.github/workflows/rustfmt.yaml

+7-11
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,16 @@ name: rustfmt
22

33
on:
44
push:
5+
branches:
6+
- main
57
pull_request:
68

79
jobs:
810
rustfmt:
911
runs-on: ubuntu-latest
1012
steps:
11-
- uses: actions/checkout@v2
12-
- uses: actions-rs/toolchain@v1
13-
with:
14-
profile: minimal
15-
toolchain: stable
16-
components: rustfmt
17-
- name: Check rustfmt
18-
uses: actions-rs/cargo@v1
19-
with:
20-
command: fmt
21-
args: -- --check
13+
- run: |
14+
rustup toolchain install stable --profile minimal --component rustfmt
15+
- uses: actions/checkout@v4
16+
- run: |
17+
cargo fmt --check

.github/workflows/test.yaml

+8-10
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,17 @@ name: test
22

33
on:
44
push:
5+
branches:
6+
- main
57
pull_request:
68

79
jobs:
810
test:
911
runs-on: ubuntu-latest
1012
steps:
11-
- uses: actions/checkout@v2
12-
- uses: actions-rs/toolchain@v1
13-
with:
14-
profile: minimal
15-
toolchain: stable
16-
- uses: Swatinem/rust-cache@v1
17-
- name: Run tests
18-
uses: actions-rs/cargo@v1
19-
with:
20-
command: test
13+
- run: |
14+
rustup toolchain install stable --profile minimal --component clippy
15+
- uses: actions/checkout@v4
16+
- uses: Swatinem/rust-cache@v2
17+
- run:
18+
cargo test

0 commit comments

Comments
 (0)