diff --git a/.github/workflows/calver.yml b/.github/workflows/calver.yml new file mode 100644 index 0000000000..b5a0e51dc9 --- /dev/null +++ b/.github/workflows/calver.yml @@ -0,0 +1,26 @@ +name: Next version number + +on: + workflow_dispatch: + workflow_call: + push: + +jobs: + calver: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Calver Release + uses: StephaneBour/actions-calver@master + id: calver + with: + date_format: "%Y.%m.%d" + release: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Deploy + run: echo ${{ env.VERSION }} + env: + VERSION: ${{ steps.calver.outputs.release }} diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000000..e4cb3e2ad9 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,78 @@ +name: Docker + +on: + workflow_call: + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} + cancel-in-progress: false + +env: + SLEEP: 60 + DOCKER_BUILDKIT: '1' + DOCKER_TEST_TAG: sickchill/sickchill:test + DOCKER_CONTAINER_NAME: sickchill_test + TARGET_PLATFORMS: "linux/amd64,linux/arm64" + CRYPTOGRAPHY_DONT_BUILD_RUST: 1 + +defaults: + run: + shell: bash + +jobs: + setup: + name: Set up Docker Environment + runs-on: ubuntu-latest + outputs: + docker_tags: ${{ steps.docker.outputs.tags }} + docker_labels: ${{ steps.docker.outputs.labels }} + steps: + - name: Cache environment files + uses: actions/cache@v3 + with: + path: /tmp/buildkitd.toml + key: ${{ github.workflow }}-environment + - name: Create buildkitd config + run: | + echo 'experimantal = true' > /tmp/buildkitd.toml + echo 'debug = true' >> /tmp/buildkitd.toml + echo 'insecure-entitlements = [ "security.insecure" ]' >> /tmp/buildkitd.toml + # echo '[worker.oci]' >> /tmp/buildkitd.toml + # echo 'max-parallelism = 1' >> /tmp/buildkitd.toml + cat /tmp/buildkitd.toml + - name: Docker meta + id: docker + uses: docker/metadata-action@v5 + with: + images: | + ${{ github.repository }} + ghcr.io/${{ github.repository }} + labels: | + org.opencontainers.image.source=https://github.com/sickchill/sickchill + org.opencontainers.image.url=https://sickchill.github.io + org.opencontainers.image.licenses=GPL-3.0+ + tags: | + type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }} + type=schedule + type=ref,event=branch + type=ref,event=tag + type=ref,event=pr + type=raw,prefix=${{ github.ref_name }},suffix=,value=${{ github.run_id }},event=push + type=raw,prefix=${{ github.ref_name }},suffix=,value=${{ github.sha }},event=push + type=raw,prefix=,suffix=,value=${{ github.head_ref }},event=pr + type=raw,prefix=,suffix=,value=${{ github.ref_name }},event=push,enable=${{ github.event_name != 'pull_request' }} + type=edge,branch=develop + type=semver,pattern={{version}},enable=${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }} + type=semver,pattern={{major}}.{{minor}},enable=${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }} + - name: Restore environment files + uses: actions/cache@v3 + with: + path: /tmp/buildkitd.toml + key: ${{ github.workflow }}-environment + restore-keys: ${{ github.workflow }}-environment + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + config: /tmp/buildkitd.toml diff --git a/Dockerfile b/Dockerfile index 86d04112dd..798db41413 100644 --- a/Dockerfile +++ b/Dockerfile @@ -68,7 +68,8 @@ ENV RUSTUP_IO_THREADS 1 ENV CARGO_TERM_VERBOSE "true" ENV CARGO "$CARGO_HOME/bin/cargo" -RUN --security=insecure curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sed 's#/proc/self/exe#$SHELL#g' | sh -s -- -y --profile minimal --default-toolchain nightly +# hadolint ignore=SC2215 +RUN --security=insecure curl --proto "=https" --tlsv1.2 -sSf https://sh.rustup.rs | sed "s#/proc/self/exe#$SHELL#g" | sh -s -- -y --profile minimal --default-toolchain nightly ENV PATH "$RUSTUP_HOME/bin:$CARGO_HOME/bin:$PATH" @@ -80,6 +81,7 @@ WORKDIR /sickchill COPY . /sickchill/ # https://github.com/rust-lang/cargo/issues/8719#issuecomment-1253575253 +# hadolint ignore=SC2215,SC1089 RUN --mount=type=tmpfs,target="$CARGO_HOME" if [ -z "$SOURCE" ]; then \ pip install --upgrade "sickchill[speedups]"; \ else \