Skip to content
This repository was archived by the owner on Oct 6, 2024. It is now read-only.

Commit b3de156

Browse files
author
NY Anchor
authored
Rust FFI + major Go refactor (#32)
* Update ci workflow * Updates to gitignore * Add dependabot configs workflow * Update github repo configs * refactor module * Add ci workflow for rust jobs * rename youtube-dl to ydl * Add download package * combine cgo with rust ffi capabilities
1 parent 208b9ca commit b3de156

26 files changed

+361
-369
lines changed

.dockerignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

.github/CODEOWNERS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
* @ch3ck
2-
File renamed without changes.

.github/ISSUE_TEMPLATE.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
name: Bug Report
3+
about: If something isn't working as its supposed to
4+
labels: bug, feature request, needs triage, won't fix
5+
assignees: ch3ck
6+
---
7+
8+
Please provide more details:
9+
10+
* What are you trying to do
11+
* What happened
12+
* What was the expected behaviour
13+
14+
Please share relevent code sample or [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example).

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
## Proposed changes
2+
Describe the *big picture* reason for your PR.
3+
4+
## Checklist
5+
6+
Please review the following checklist before submitting a PR:
7+
8+
- [ ] **CONSIDER** adding a unit test to demonstrate your PR resolves an issue
9+
- [ ] **DO** keep PRs small for easy review
10+
- [ ] **DO** make sure unit tests pass
11+
- [ ] **DO** ensure no compiler warnings are triggered
12+
- [ ] **AVOID** breaking the CI builds
13+
14+
## Other comments
15+
Any other comments you might have.

.github/issue_template.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,40 @@
1-
name: Build
1+
name: CI
22

33
on: [push, pull_request]
44

55

66
jobs:
7-
setup-build-test:
8-
name: Setup, Build, Test
7+
build-and-test-rust-library:
8+
name: Build and test rust library
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: checkout source
12+
uses: actions/checkout@v2
13+
- name: install latest nightly
14+
uses: actions-rs/toolchain@v1
15+
with:
16+
toolchain: nightly
17+
override: true
18+
components: rustfmt, clippy
19+
- name: build and test
20+
working-directory: ./pkg/download
21+
run: |
22+
cargo build --tests --verbose && cargo test --verbose
23+
build-and-test-go-module:
24+
name: Build and test go source
925
strategy:
1026
matrix:
11-
go-version: [1.13.x]
12-
platform: [macos-latest]
13-
runs-on: ${{ matrix.platform }}
27+
go-version: [1.16.x, 1.17.x, 1.18.x]
28+
platform: [macos-latest, ubuntu-latest, windows-latest]
29+
runs-on: ${{ matrix.os }}
1430
steps:
15-
- name: Setup Go
16-
uses: actions/setup-go@v1
31+
- name: Install go
32+
uses: actions/setup-go@v2
1733
with:
1834
go-version: ${{ matrix.go-version }}
1935
- name: Checkout code
20-
uses: actions/checkout@v1
36+
uses: actions/checkout@v2
37+
- name: Test
38+
run: go test -v -coverage ./...
2139
- name: Build
22-
run: brew install ffmpeg && make build && make vet
40+
run: make

.github/workflows/dependabot.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
# Maintain dependencies for Go
9+
- package-ecosystem: "gomod"
10+
directory: "/"
11+
schedule:
12+
interval: "weekly"
13+
14+
# Maintain dependencies for build tools
15+
- package-ecosystem: "gomod"
16+
directory: "/tools"
17+
schedule:
18+
interval: "weekly"

.github/workflows/release.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: release new binaries
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
reason:
7+
description: new release message
8+
required: true
9+
push:
10+
tags:
11+
- "*"
12+
13+
permissions:
14+
contents: write
15+
16+
17+
jobs:
18+
publish-crate-on-new-release:
19+
name: "Publish crate on Release"
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v2
23+
- uses: actions-rs/toolchain@v1
24+
with:
25+
toolchain: stable
26+
override: true
27+
- uses: katyo/publish-crates@v1
28+
with:
29+
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
30+
publish-go-package-on-release:
31+
name: Release go binaries
32+
runs-on: ubuntu-latest
33+
steps:
34+
- name: Checkout
35+
uses: actions/checkout@v2
36+
with:
37+
fetch-depth: 0
38+
- name: Setup Go
39+
uses: actions/setup-go@v2
40+
with:
41+
go-version: 1.17
42+
- name: Run GoReleaser
43+
uses: goreleaser/goreleaser-action@v2
44+
with:
45+
distribution: goreleaser
46+
version: latest
47+
args: release --rm-dist
48+
env:
49+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50+
# GoReleaser Pro key, for 'goreleaser-pro' distribution
51+
# GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}

.github/workflows/security.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Run security audit
2+
# Author: Nyah Check
3+
name: Run Security Audit
4+
5+
on:
6+
push:
7+
paths:
8+
- '**/Cargo.toml'
9+
- '**/Cargo.lock'
10+
11+
jobs:
12+
run-security-audit:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v1
16+
- uses: actions-rs/audit-check@v1
17+
with:
18+
token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)