Skip to content

Commit

Permalink
try calver output
Browse files Browse the repository at this point in the history
Signed-off-by: miigotu <[email protected]>
  • Loading branch information
miigotu committed Oct 20, 2023
1 parent 5a08281 commit 83581b2
Show file tree
Hide file tree
Showing 3 changed files with 107 additions and 1 deletion.
26 changes: 26 additions & 0 deletions .github/workflows/calver.yml
Original file line number Diff line number Diff line change
@@ -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 }}
78 changes: 78 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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 \
Expand Down

0 comments on commit 83581b2

Please sign in to comment.