Skip to content

Commit 216c3e9

Browse files
committed
Initial release v1.0.0
0 parents  commit 216c3e9

92 files changed

Lines changed: 30446 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dockerignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
target/
2+
frontend/dist/
3+
frontend/target/
4+
.git/
5+
release/
6+
downloads/
7+
*.gz
8+
*.exe
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
name: release build
2+
on:
3+
push:
4+
tags:
5+
- 'v*'
6+
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
build:
12+
if: github.repository_owner == 'OctopusTakopi'
13+
name: Build ${{ matrix.os }}-${{ matrix.arch }}${{ matrix.suffix }}
14+
runs-on: ${{ matrix.runner }}
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
include:
19+
- os: linux
20+
arch: amd64
21+
suffix: _static
22+
extra: static
23+
pkg: gzip
24+
runner: ubuntu-latest
25+
- os: linux
26+
arch: arm64
27+
suffix: ""
28+
extra: ""
29+
pkg: gzip
30+
runner: ubuntu-24.04-arm
31+
- os: windows
32+
arch: amd64
33+
suffix: ""
34+
extra: ""
35+
pkg: zip
36+
runner: ubuntu-latest
37+
steps:
38+
- name: Install dependencies
39+
run: |
40+
sudo apt-get update
41+
sudo apt-get install -y gcc-aarch64-linux-gnu mingw-w64 musl-tools gzip zip curl git perl make libssl-dev pkg-config
42+
43+
- name: Check out code
44+
uses: actions/checkout@v4
45+
46+
- name: Install Rust targets
47+
run: |
48+
rustup target add x86_64-unknown-linux-musl || true
49+
rustup target add aarch64-unknown-linux-gnu || true
50+
rustup target add x86_64-pc-windows-gnu || true
51+
rustup target add wasm32-unknown-unknown
52+
53+
- name: Install Trunk
54+
run: |
55+
ARCH=$(uname -m)
56+
case "${ARCH}" in
57+
x86_64) TRUNK_ARCH="x86_64" ;;
58+
aarch64) TRUNK_ARCH="aarch64" ;;
59+
*) TRUNK_ARCH="x86_64" ;;
60+
esac
61+
curl -L "https://github.com/thedodd/trunk/releases/download/v0.21.14/trunk-${TRUNK_ARCH}-unknown-linux-gnu.tar.gz" \
62+
| tar -xzf- -C /usr/local/bin
63+
64+
- name: Build and Package
65+
run: |
66+
git config --global --add safe.directory "$GITHUB_WORKSPACE"
67+
bash scripts/make_release.sh ${{ matrix.os }} ${{ matrix.arch }} ${{ matrix.extra }} ${{ matrix.pkg }}
68+
69+
- name: Upload Artifacts
70+
uses: actions/upload-artifact@v4
71+
with:
72+
name: release-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.suffix }}
73+
path: release/
74+
retention-days: 1
75+
76+
release:
77+
name: Create Release
78+
needs: build
79+
runs-on: ubuntu-latest
80+
steps:
81+
- name: Check out code
82+
uses: actions/checkout@v4
83+
with:
84+
fetch-depth: '0'
85+
86+
- name: Download all artifacts
87+
uses: actions/download-artifact@v4
88+
with:
89+
path: release
90+
pattern: release-*
91+
merge-multiple: true
92+
93+
- name: Generate Git Log
94+
run: |
95+
echo "Current Tag: ${GITHUB_REF}"
96+
GITVER=$(git describe --tags --always)
97+
PREVVER=$(git describe --tags --abbrev=0 ${GITVER}~1 2>/dev/null || echo "")
98+
if [ -n "$PREVVER" ]; then
99+
git log --oneline ${PREVVER}..${GITVER} | tee -a gittaglogs.txt
100+
else
101+
git log --oneline | tee -a gittaglogs.txt
102+
fi
103+
104+
- name: Debug Artifacts
105+
run: ls -la release/
106+
107+
- name: Release
108+
uses: softprops/action-gh-release@v2
109+
if: startsWith(github.ref, 'refs/tags/')
110+
with:
111+
files: release/*
112+
prerelease: false
113+
draft: true
114+
body_path: gittaglogs.txt
115+
env:
116+
GITHUB_TOKEN: ${{ secrets.MY_GITHUB_TOKEN }}

.github/workflows/docker-push.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: docker build
2+
on:
3+
push:
4+
tags:
5+
- 'v*'
6+
7+
jobs:
8+
build:
9+
if: github.repository_owner == 'OctopusTakopi'
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
16+
- name: Set up QEMU
17+
uses: docker/setup-qemu-action@v3
18+
- name: Set up Docker Buildx
19+
uses: docker/setup-buildx-action@v3
20+
- name: Login to DockerHub
21+
uses: docker/login-action@v3
22+
with:
23+
username: ${{ secrets.DOCKER_USERNAME }}
24+
password: ${{ secrets.DOCKER_PASSWORD }}
25+
26+
- name: Get tag to build
27+
id: tag
28+
run: |
29+
latest_tag=$(git describe --tags | cut -d- -f1)
30+
echo "Use the latest release tag: ${latest_tag}"
31+
echo "tag=${latest_tag}" >> $GITHUB_OUTPUT
32+
33+
- name: Prepare environment variables
34+
id: prepare
35+
run: |
36+
echo "docker_platforms=linux/amd64,linux/arm64" >> $GITHUB_OUTPUT
37+
echo "docker_image=octopustakopi/cloud-torrent-rs" >> $GITHUB_OUTPUT
38+
echo "docker_tag=${{ steps.tag.outputs.tag }}" >> $GITHUB_OUTPUT
39+
40+
- name: Build tag & latest release
41+
run: |
42+
docker buildx build --platform ${{ steps.prepare.outputs.docker_platforms }} \
43+
--output "type=image,push=true" \
44+
--tag "${{ steps.prepare.outputs.docker_image }}:${{ steps.prepare.outputs.docker_tag }}" \
45+
--tag "${{ steps.prepare.outputs.docker_image }}:latest" \
46+
--file Dockerfile .

.github/workflows/lint.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: lint
2+
on: [push, pull_request]
3+
jobs:
4+
lint:
5+
name: Lint
6+
runs-on: ubuntu-latest
7+
container: rust:1-bookworm
8+
timeout-minutes: 30
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v4
12+
13+
- name: Install system deps
14+
run: apt-get update && apt-get install -y pkg-config libssl-dev
15+
16+
- name: Install wasm32 target & trunk
17+
run: |
18+
rustup target add wasm32-unknown-unknown
19+
ARCH=$(uname -m)
20+
case "${ARCH}" in
21+
x86_64) TRUNK_ARCH="x86_64" ;;
22+
aarch64) TRUNK_ARCH="aarch64" ;;
23+
*) TRUNK_ARCH="x86_64" ;;
24+
esac
25+
curl -L "https://github.com/thedodd/trunk/releases/download/v0.21.14/trunk-${TRUNK_ARCH}-unknown-linux-gnu.tar.gz" \
26+
| tar -xzf- -C /usr/local/bin
27+
28+
- name: Check Formatting
29+
run: rustup component add rustfmt clippy && cargo fmt -- --check
30+
31+
- name: Run Clippy
32+
run: cargo clippy -- -D warnings
33+
34+
- name: Check Frontend Formatting
35+
run: cd frontend && cargo fmt -- --check
36+
37+
- name: Clippy Frontend
38+
run: cd frontend && cargo clippy --target wasm32-unknown-unknown -- -D warnings

.gitignore

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Generated by Cargo
2+
# will have compiled files and executables
3+
debug
4+
target
5+
/target
6+
/release
7+
/downloads
8+
/cloud-torrent.yaml
9+
*.pem
10+
test_*.pem
11+
.DS_Store
12+
**/.DS_Store
13+
14+
# These are backup files generated by rustfmt
15+
**/*.rs.bk
16+
17+
# MSVC Windows builds of rustc generate these, which store debugging information
18+
*.pdb
19+
20+
# Generated by cargo mutants
21+
# Contains mutation testing data
22+
**/mutants.out*/
23+
24+
# RustRover
25+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
26+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
27+
# and can be added to the global gitignore or merged into this file. For a more nuclear
28+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
29+
#.idea/
30+

0 commit comments

Comments
 (0)