Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
JakeWharton committed Mar 7, 2021
0 parents commit e13768c
Show file tree
Hide file tree
Showing 19 changed files with 1,132 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/.git
/.gradle
/build
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
indent_style = tab
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.yaml]
indent_style = space
42 changes: 42 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: build

on:
pull_request:
push:
branches:
- '**'
- '!trunk'

env:
GRADLE_OPTS: "-Dorg.gradle.jvmargs=-Xmx4g -Dorg.gradle.daemon=false -Dkotlin.incremental=false"

jobs:
gradle:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- uses: gradle/wrapper-validation-action@v1

- uses: actions/setup-java@v1
with:
java-version: 1.8

- run: ./gradlew build

- uses: actions/upload-artifact@v2
with:
name: plex-orphaned-files.zip
path: build/distributions/plex-orphaned-files.zip

docker:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- uses: gradle/wrapper-validation-action@v1

- name: Build
run: docker build .
97 changes: 97 additions & 0 deletions .github/workflows/build_and_publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: build and publish

on:
push:
branches:
- trunk
tags:
- '*'

env:
GRADLE_OPTS: "-Dorg.gradle.jvmargs=-Xmx4g -Dorg.gradle.daemon=false -Dkotlin.incremental=false"

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- uses: gradle/wrapper-validation-action@v1

- uses: actions/setup-java@v1
with:
java-version: 1.8

- run: ./gradlew build

- uses: actions/upload-artifact@v2
with:
name: plex-orphaned-files.zip
path: build/distributions/plex-orphaned-files.zip

- uses: crazy-max/ghaction-docker-meta@v1
id: docker_meta
with:
images: |
jakewharton/plex-orphaned-files
ghcr.io/jakewharton/plex-orphaned-files
tag-semver: |
{{version}}
{{major}}
{{major}}.{{minor}}
- uses: docker/login-action@v1
with:
username: jakewharton
password: ${{ secrets.DOCKER_HUB_TOKEN }}

- run: echo ${{ secrets.GHCR_TOKEN }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin

- uses: docker/build-push-action@v2
with:
push: true
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}

- name: Extract release notes
id: release_notes
if: startsWith(github.ref, 'refs/tags/')
uses: ffurrer2/extract-release-notes@v1

- name: Create Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
body: ${{ steps.release_notes.outputs.release_notes }}
files: build/distributions/plex-orphaned-files.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Get version
id: get_version
if: startsWith(github.ref, 'refs/tags/')
run: echo ::set-output name=version::${GITHUB_REF/refs\/tags\//}

- name: Set SHA
id: shasum
if: startsWith(github.ref, 'refs/tags/')
run: echo ::set-output name=sha::"$(shasum -a 256 build/distributions/plex-orphaned-files.zip | awk '{printf $1}')"

# - name: Bump Brew
# if: startsWith(github.ref, 'refs/tags/')
# env:
# HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.GH_HOMEBREW_TOKEN }}
# run: |
# git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
# git config --global user.name "github-actions[bot]"
#
# # Update to ensure we have the latest version which supports arbitrary default branches.
# brew update
#
# brew tap JakeWharton/repo
# brew bump-formula-pr -f --version=${{ steps.get_version.outputs.version }} --no-browse --no-audit \
# --sha256=${{ steps.shasum.outputs.sha }} \
# --url="https://github.com/JakeWharton/plex-orphaned-files/releases/download/${{ steps.get_version.outputs.version }}/plex-orphaned-files.zip" \
# JakeWharton/repo/plex-orphaned-files
#
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Gradle
build
.gradle
/reports

# IntelliJ
.idea
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Changelog

## [Unreleased]


## [1.0.0]

- Initial release


[Unreleased]: https://github.com/JakeWharton/plex-orphaned-files/compare/1.0.0...HEAD
[1.0.0]: https://github.com/JakeWharton/plex-orphaned-files/releases/tag/1.0.0
27 changes: 27 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM adoptopenjdk:8-jdk-hotspot AS build
ENV GRADLE_OPTS="-Dorg.gradle.daemon=false -Dkotlin.incremental=false"
WORKDIR /app

COPY gradlew settings.gradle ./
COPY gradle ./gradle
RUN ./gradlew --version

COPY build.gradle ./
COPY src ./src
RUN ./gradlew build


FROM alpine:3.13
LABEL maintainer="Jake Wharton <docker@jakewharton.com>"

RUN apk add --no-cache \
curl \
openjdk8-jre \
&& rm -rf /var/cache/* \
&& mkdir /var/cache/apk

WORKDIR /app
COPY --from=build /app/build/install/plex-orphaned-files ./

ENTRYPOINT ["/app/bin/plex-orphaned-files"]
CMD ["--help"]
Loading

0 comments on commit e13768c

Please sign in to comment.