Compare commits

...

59 commits
v0.2.0 ... main

Author SHA1 Message Date
b28c753f1d chore(deps): update dependency mix_audit to v2.1.4
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-07-17 02:32:52 +12:00
ca1ab16c53 chore(deps): update dependency erlang to v27.0.1
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-07-11 01:40:42 +12:00
29d39f6e7c chore(deps): update dependency ex_doc to v0.34.2
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-07-10 07:34:59 +12:00
7eeaf6a3db chore(deps): update dependency elixir to v1.17.2
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-07-07 09:39:16 +12:00
a7bea92469 chore(deps): update dependency elixir to v1.17.1
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
continuous-integration/drone Build is passing
2024-06-21 03:21:42 +12:00
097e06e3ea chore(deps): update dependency ex_doc to v0.34.1
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-06-21 02:22:21 +12:00
7a205e048e chore(deps): update dependency elixir to v1.17.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-06-15 13:43:58 +12:00
3e814cbb16 chore(deps): update dependency credo to v1.7.7
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-06-15 12:53:35 +12:00
b4990ebc26 chore(deps): update dependency ex_doc to v0.34.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-05-31 01:24:53 +12:00
c18f255ae0 chore(deps): update dependency ex_doc to v0.33.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-05-22 01:21:06 +12:00
e935d8c9b5 chore(deps): update dependency elixir to v1.16.3
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-05-21 11:22:05 +12:00
b5a97d2b5f chore(deps): update dependency erlang to v27
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-05-20 21:43:33 +12:00
0314386bb3 chore(deps): update dependency git_ops to v2.6.1
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-05-11 10:40:28 +12:00
c4ace467ba chore(deps): update dependency ex_doc to v0.32.2
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-05-10 23:38:47 +12:00
bd4a0d817a chore(deps): update dependency credo to v1.7.6
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-05-09 23:59:09 +12:00
92ea438df1 chore(deps): update dependency erlang to v26.2.5
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-05-03 03:36:14 +12:00
f284bd459b chore(deps): update dependency ex_doc to v0.32.1
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-04-13 08:35:38 +12:00
976aee8c3c chore(deps): update dependency erlang to v26.2.4
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-04-13 00:36:24 +12:00
a41f4dedfa chore(deps): update dependency ex_doc to v0.32.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-04-10 21:33:02 +12:00
9249df1fb2 chore(deps): update dependency mix_audit to v2.1.3
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-03-19 16:07:36 +13:00
37c2d176d3
chore: fix docs release.
All checks were successful
continuous-integration/drone/push Build is passing
2024-03-14 19:29:27 +13:00
a4aeaee78d chore(deps): update dependency dialyxir to v1.4.3
All checks were successful
continuous-integration/drone/push Build is passing
2024-03-14 15:03:56 +13:00
126ee247e6 chore(deps): update dependency ex_doc to v0.31.2
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-03-14 00:52:34 +00:00
b3b79d4109 chore(deps): update dependency mix_audit to v2.1.2
All checks were successful
continuous-integration/drone/push Build is passing
2024-03-14 13:11:39 +13:00
cd26f7d51a chore(deps): update dependency credo to v1.7.5
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-03-13 21:17:20 +00:00
342381af56 chore(deps): update dependency elixir to v1.16.2
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-03-11 00:36:44 +13:00
708b9ab40b
chore: fix typo in readme
All checks were successful
continuous-integration/drone/push Build is passing
2024-03-08 14:48:06 +13:00
d609dd03d9 chore(deps): update dependency erlang to v26.2.3
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-03-07 22:32:14 +13:00
1718cee34a
chore: Update package and readme links.
All checks were successful
continuous-integration/drone/push Build is passing
2024-03-06 20:02:54 +13:00
b9320737af chore(deps): update dependency ex_check to ~> 0.16.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-03-01 23:28:42 +13:00
2a45fe95a8 chore(deps): update dependency erlang to v26.2.2
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-02-09 10:48:01 +13:00
9b767c6e91 chore: Update forgejo hostname.
All checks were successful
continuous-integration/drone/push Build is passing
2024-02-05 15:16:32 +13:00
82a46edbc8 chore(deps): update dependency elixir to v1.16.1
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-01-31 23:21:35 +13:00
50273d22c9 chore(deps): update dependency elixir to v1.16.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-12-23 06:31:41 +13:00
1fe6d44d7c chore(deps): update dependency erlang to v26.2.1
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-12-19 04:09:26 +13:00
2b41144d55 chore(deps): update dependency erlang to v26.2
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-12-13 21:14:05 +13:00
31d1a70b32 chore(deps): update dependency elixir to v1.15.7
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-10-14 23:25:39 +13:00
5a89e13b4b chore(deps): update dependency erlang to v26.1.2
Some checks failed
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is failing
2023-10-12 21:25:28 +13:00
a47c070e3d chore(deps): update dependency erlang to v26.1.1
Some checks failed
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is failing
2023-09-28 22:25:05 +13:00
45c6e0c091 chore(deps): update dependency erlang to v26.1
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-09-21 11:09:29 +12:00
5bf14ecff0 chore: simplify CI configuration. (#18)
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: https://code.harton.nz/james/vivid_png/pulls/18
Co-authored-by: James Harton <james@harton.nz>
Co-committed-by: James Harton <james@harton.nz>
2023-09-21 10:48:18 +12:00
37232856ff chore(deps): update dependency elixir to v1.15.6
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-09-20 21:18:55 +12:00
82007cd7e2 chore(deps): update dependency elixir to v1.15.5
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-08-29 00:23:45 +12:00
aceef86b10
chore: update README.
All checks were successful
continuous-integration/drone/push Build is passing
2023-08-19 19:22:09 +12:00
273bc53020 chore: update renovate configuration.
All checks were successful
continuous-integration/drone/push Build is passing
2023-08-17 15:53:46 +12:00
95d4475271 chore: Modernise CI/CD and migrate. (#13)
All checks were successful
continuous-integration/drone/push Build is passing
Co-authored-by: James Harton <james@harton.nz>
Reviewed-on: https://code.harton.nz/james/vivid_png/pulls/13
2023-07-27 20:08:44 +12:00
e125cd3e94 chore(deps): update dependency ex_doc to >= 0.28.1 2022-02-21 09:24:12 +13:00
cf6763eaea chore(deps): update dependency ex_doc to >= 0.28.0 2022-01-31 13:29:16 +13:00
735d7ac4a4 chore(deps): update dependency git_ops to ~> 2.4 2021-12-09 15:06:42 +13:00
f4824becc6 chore(deps): update dependency ex_doc to >= 0.26.0 2021-12-09 13:34:33 +13:00
5c67c4ebb8 chore(deps): update dependency credo to ~> 1.6 2021-12-09 11:46:08 +13:00
6fd9dbd2e4 chore: update renovate.json 2021-12-09 11:30:16 +13:00
79b56d8474 Update dependency png to ~> 0.2 2021-12-08 17:39:27 +13:00
cc880a1e6a chore: update renovate.json 2021-12-08 17:36:27 +13:00
af5ddd50d0 chore(dev-deps): Update git_ops to 2.4.5. 2021-12-08 12:09:19 +13:00
dba2184e10 chore(dev-deps): Update ex_doc to 0.26.0. 2021-12-08 12:03:31 +13:00
5c1fe2a4bf chore(dev-deps): Update credo to 1.6.1. 2021-12-08 11:59:01 +13:00
4a7bfc8b67 chore: change default branch to main. 2021-12-08 11:55:27 +13:00
590723935e chore: fix git_ops config. 2020-12-28 20:28:28 +13:00
10 changed files with 476 additions and 170 deletions

33
.check.exs Normal file
View file

@ -0,0 +1,33 @@
[
## don't run tools concurrently
# parallel: false,
## don't print info about skipped tools
skipped: false,
## always run tools in fix mode (put it in ~/.check.exs locally, not in project config)
# fix: true,
## don't retry automatically even if last run resulted in failures
# retry: false,
## list of tools (see `mix check` docs for a list of default curated tools)
tools: [
## curated tools may be disabled (e.g. the check for compilation warnings)
# {:compiler, false},
## ...or have command & args adjusted (e.g. enable skip comments for sobelow)
{:sobelow, false},
## ...or reordered (e.g. to see output from dialyzer before others)
# {:dialyzer, order: -1},
## ...or reconfigured (e.g. disable parallel execution of ex_unit in umbrella)
# {:ex_unit, umbrella: [parallel: false]},
## custom new tools may be added (Mix tasks or arbitrary commands)
# {:my_task, "mix my_task", env: %{"MIX_ENV" => "prod"}},
# {:my_tool, ["my_tool", "arg with spaces"]}
# {:esbuild, "mix esbuild prod"}
]
]

366
.drone.yml Normal file
View file

@ -0,0 +1,366 @@
kind: pipeline
type: docker
name: build
steps:
- name: restore ASDF cache
image: meltwater/drone-cache
pull: "always"
environment:
AWS_ACCESS_KEY_ID:
from_secret: ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY:
from_secret: SECRET_ACCESS_KEY
AWS_PLUGIN_PATH_STYLE: true
settings:
restore: true
endpoint:
from_secret: S3_ENDPOINT
bucket:
from_secret: CACHE_BUCKET
region: us-east-1
path-style: true
cache_key: 'asdf-{{ os }}-{{ arch }}-{{ checksum ".tool-versions" }}'
mount:
- .asdf
- name: restore build cache
image: meltwater/drone-cache
environment:
AWS_ACCESS_KEY_ID:
from_secret: ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY:
from_secret: SECRET_ACCESS_KEY
AWS_PLUGIN_PATH_STYLE: true
settings:
restore: true
endpoint:
from_secret: S3_ENDPOINT
bucket:
from_secret: CACHE_BUCKET
region: us-east-1
path-style: true
cache_key: 'elixir-{{ checksum "mix.lock" }}-{{ checksum ".tool-versions" }}'
mount:
- deps
- _build
- .hex
- .mix
- .rebar3
- name: install dependencies
image: harton.dev/james/asdf_container:latest
pull: "always"
environment:
MIX_ENV: test
HEX_HOME: /drone/src/.hex
MIX_HOME: /drone/src/.mix
REBAR_BASE_DIR: /drone/src/.rebar3
ASDF_DATA_DIR: /drone/src/.asdf
ASDF_DIR: /root/.asdf
depends_on:
- restore ASDF cache
- restore build cache
commands:
- asdf_install
- rm -rf .asdf/downloads
- . $ASDF_DIR/asdf.sh
- mix local.hex --if-missing --force
- mix local.rebar --if-missing --force
- mix deps.get
- mix deps.compile
- name: store ASDF cache
image: meltwater/drone-cache
environment:
AWS_ACCESS_KEY_ID:
from_secret: ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY:
from_secret: SECRET_ACCESS_KEY
AWS_PLUGIN_PATH_STYLE: true
depends_on:
- install dependencies
settings:
rebuild: true
override: false
endpoint:
from_secret: S3_ENDPOINT
bucket:
from_secret: CACHE_BUCKET
region: us-east-1
path-style: true
cache_key: 'asdf-{{ os }}-{{ arch }}-{{ checksum ".tool-versions" }}'
mount:
- .asdf
- name: store build cache
image: meltwater/drone-cache
environment:
AWS_ACCESS_KEY_ID:
from_secret: ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY:
from_secret: SECRET_ACCESS_KEY
AWS_PLUGIN_PATH_STYLE: true
depends_on:
- install dependencies
settings:
rebuild: true
override: false
endpoint:
from_secret: S3_ENDPOINT
bucket:
from_secret: CACHE_BUCKET
region: us-east-1
path-style: true
cache_key: 'elixir-{{ checksum "mix.lock" }}-{{ checksum ".tool-versions" }}'
mount:
- deps
- _build
- .hex
- .mix
- .rebar3
- name: mix compile
image: harton.dev/james/asdf_container:latest
environment:
MIX_ENV: test
HEX_HOME: /drone/src/.hex
MIX_HOME: /drone/src/.mix
REBAR_BASE_DIR: /drone/src/.rebar3
ASDF_DATA_DIR: /drone/src/.asdf
depends_on:
- install dependencies
commands:
- asdf mix compile --warnings-as-errors
- name: mix test
image: harton.dev/james/asdf_container:latest
environment:
MIX_ENV: test
HEX_HOME: /drone/src/.hex
MIX_HOME: /drone/src/.mix
REBAR_BASE_DIR: /drone/src/.rebar3
ASDF_DATA_DIR: /drone/src/.asdf
depends_on:
- mix compile
commands:
- asdf mix test
- name: mix credo
image: harton.dev/james/asdf_container:latest
environment:
MIX_ENV: test
HEX_HOME: /drone/src/.hex
MIX_HOME: /drone/src/.mix
REBAR_BASE_DIR: /drone/src/.rebar3
ASDF_DATA_DIR: /drone/src/.asdf
depends_on:
- mix compile
commands:
- asdf mix credo --strict
- name: mix hex.audit
image: harton.dev/james/asdf_container:latest
environment:
MIX_ENV: test
HEX_HOME: /drone/src/.hex
MIX_HOME: /drone/src/.mix
REBAR_BASE_DIR: /drone/src/.rebar3
ASDF_DATA_DIR: /drone/src/.asdf
depends_on:
- mix compile
commands:
- asdf mix hex.audit
- name: mix format
image: harton.dev/james/asdf_container:latest
environment:
MIX_ENV: test
HEX_HOME: /drone/src/.hex
MIX_HOME: /drone/src/.mix
REBAR_BASE_DIR: /drone/src/.rebar3
ASDF_DATA_DIR: /drone/src/.asdf
depends_on:
- mix compile
commands:
- asdf mix format --check-formatted
- name: mix deps.unlock
image: harton.dev/james/asdf_container:latest
environment:
MIX_ENV: test
HEX_HOME: /drone/src/.hex
MIX_HOME: /drone/src/.mix
REBAR_BASE_DIR: /drone/src/.rebar3
ASDF_DATA_DIR: /drone/src/.asdf
depends_on:
- mix compile
commands:
- asdf mix deps.unlock --check-unused
- name: mix doctor
image: harton.dev/james/asdf_container:latest
environment:
MIX_ENV: test
HEX_HOME: /drone/src/.hex
MIX_HOME: /drone/src/.mix
REBAR_BASE_DIR: /drone/src/.rebar3
ASDF_DATA_DIR: /drone/src/.asdf
depends_on:
- mix compile
commands:
- asdf mix doctor --full
- name: mix git_ops.check_message
image: harton.dev/james/asdf_container:latest
environment:
MIX_ENV: test
HEX_HOME: /drone/src/.hex
MIX_HOME: /drone/src/.mix
REBAR_BASE_DIR: /drone/src/.rebar3
ASDF_DATA_DIR: /drone/src/.asdf
depends_on:
- mix compile
commands:
- git log -1 --format=%s > .last_commit_message
- asdf mix git_ops.check_message .last_commit_message
- name: mix git_ops.release
image: harton.dev/james/asdf_container:latest
when:
branch:
- main
event:
exclude:
- pull_request
depends_on:
- mix test
- mix credo
- mix hex.audit
- mix format
- mix deps.unlock
- mix doctor
- mix git_ops.check_message
environment:
MIX_ENV: test
HEX_HOME: /drone/src/.hex
MIX_HOME: /drone/src/.mix
REBAR_BASE_DIR: /drone/src/.rebar3
ASDF_DATA_DIR: /drone/src/.asdf
ASDF_DIR: /root/.asdf
DRONE_TOKEN:
from_secret: DRONE_TOKEN
commands:
- git fetch --tags
- . $ASDF_DIR/asdf.sh
- mix git_ops.project_info --format=shell > before.env
- mix git_ops.release --yes --no-major || true
- mix git_ops.project_info --format=shell > after.env
- . ./before.env
- export OLD_APP_VERSION=$${APP_VERSION}
- . ./after.env
- export NEW_APP_VERSION=$${APP_VERSION}
- if [ "v$${OLD_APP_VERSION}" != "v$${NEW_APP_VERSION}" ]; then
- export GIT_URL=$(echo $DRONE_GIT_HTTP_URL | sed -e "s/:\\/\\//:\\/\\/$DRONE_REPO_OWNER:$DRONE_TOKEN@/")
- git push $${GIT_URL} "HEAD:${DRONE_COMMIT_REF}" "refs/tags/v$${NEW_APP_VERSION}"
- fi
- name: build artifacts
image: harton.dev/james/asdf_container:latest
when:
event:
- tag
refs:
include:
- refs/tags/v*
depends_on:
- mix test
- mix credo
- mix hex.audit
- mix format
- mix deps.unlock
- mix doctor
- mix git_ops.check_message
environment:
MIX_ENV: test
HEX_HOME: /drone/src/.hex
MIX_HOME: /drone/src/.mix
REBAR_BASE_DIR: /drone/src/.rebar3
ASDF_DATA_DIR: /drone/src/.asdf
ASDF_DIR: /root/.asdf
commands:
- . $ASDF_DIR/asdf.sh
- mix git_ops.project_info --format=shell > app.env
- . ./app.env
- mkdir artifacts
- mix hex.build -o "artifacts/$${APP_NAME}-$${APP_VERSION}-pkg.tar"
- gzip "artifacts/$${APP_NAME}-$${APP_VERSION}-pkg.tar"
- mix docs
- tar zcvf "artifacts/$${APP_NAME}-$${APP_VERSION}-docs.tar.gz" doc/
- git tag -l --format='%(contents:subject)' v$${APP_VERSION} > tag_subject
- git tag -l --format='%(contents:body)' v$${APP_VERSION} > tag_body
- name: gitea release
image: plugins/gitea-release
when:
event:
- tag
refs:
include:
- refs/tags/v*
depends_on:
- build artifacts
settings:
api_key:
from_secret: DRONE_TOKEN
base_url: https://harton.dev
files: artifacts/*.tar.gz
checksum: sha256
title: tag_subject
note: tag_body
- name: docs release
when:
event:
- tag
refs:
include:
- refs/tags/v*
image: minio/mc
environment:
S3_ENDPOINT:
from_secret: S3_ENDPOINT
ACCESS_KEY:
from_secret: ACCESS_KEY_ID
SECRET_KEY:
from_secret: SECRET_ACCESS_KEY
depends_on:
- build artifacts
commands:
- mc alias set store $${S3_ENDPOINT} $${ACCESS_KEY} $${SECRET_KEY}
- mc mb -p store/docs.harton.nz
- mc mirror --overwrite doc/ store/docs.harton.nz/$${DRONE_REPO}/$${DRONE_TAG}
- mc mirror --overwrite doc/ store/docs.harton.nz/$${DRONE_REPO}
- name: hex release
image: harton.dev/james/asdf_container:latest
when:
event:
- tag
refs:
include:
- refs/tags/v*
depends_on:
- build artifacts
environment:
MIX_ENV: test
HEX_HOME: /drone/src/.hex
MIX_HOME: /drone/src/.mix
REBAR_BASE_DIR: /drone/src/.rebar3
ASDF_DATA_DIR: /drone/src/.asdf
ASDF_DIR: /root/.asdf
HEX_API_KEY:
from_secret: HEX_API_KEY
commands:
- . $ASDF_DIR/asdf.sh
- mix hex.publish --yes

View file

@ -1,139 +0,0 @@
stages:
- build
- test
- release
variables:
MIX_ENV: "test"
PACKAGE_REGISTRY_URL: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/"
HEX_HOME: "$CI_PROJECT_DIR/.hex"
MIX_HOME: "$CI_PROJECT_DIR/.mix"
build:
image: elixir:latest
stage: build
cache:
key: "$CI_JOB_NAME"
paths:
- deps
- _build
- .hex
- .mix
script:
- mix local.hex --force
- mix local.rebar --force
- mix deps.get
- mix deps.compile
- mix git_ops.project_info -f dotenv > project_info.env
artifacts:
paths:
- _build/
- deps/
- .hex
- .mix
reports:
dotenv: project_info.env
test:
image: elixir:latest
dependencies:
- build
stage: test
script:
- mix test
credo:
image: elixir:latest
dependencies:
- build
stage: test
script:
- mix credo
audit:
image: elixir:latest
dependencies:
- build
stage: test
script:
- mix hex.audit
format:
image: elixir:latest
dependencies:
- build
stage: test
script:
- mix format --check-formatted
pages:
image: elixir:latest
dependencies:
- build
stage: release
script:
- mix docs -o public
artifacts:
paths:
- public
only:
- master
git_ops:
image: elixir:latest
dependencies:
- build
stage: release
only:
refs:
- master
except:
variables:
- $CI_COMMIT_MESSAGE =~ /chore\:\ release version/
script:
- |
export OLD_APP_VERSION=$APP_VERSION
mkdir -p artifacts
git config --global user.name "Gitlab Runner for ${GITLAB_USER_NAME}"
git config --global user.email "${GITLAB_USER_EMAIL}"
mix git_ops.release --yes || true
mix git_ops.project_info -f shell > artifacts/env
source artifacts/env
if [ "v${OLD_APP_VERSION}" != "v${APP_VERSION}" ]; then
mix hex.build -o "artifacts/${APP_NAME}-${APP_VERSION}.tar"
gzip "artifacts/${APP_NAME}-${APP_VERSION}.tar"
mix docs && tar zcvf "artifacts/${APP_NAME}-${APP_VERSION}-docs.tar.gz" doc/
curl --header "JOB_TOKEN: ${CI_JOB_TOKEN}" --upload-file "artifacts/${APP_NAME}-${APP_VERSION}.tar.gz" "${PACKAGE_REGISTRY_URL}/${APP_NAME}/${APP_VERSION}/${APP_NAME}-${APP_VERSION}.tar.gz"
curl --header "JOB_TOKEN: ${CI_JOB_TOKEN}" --upload-file "artifacts/${APP_NAME}-${APP_VERSION}-docs.tar.gz" "${PACKAGE_REGISTRY_URL}/${APP_NAME}/${APP_VERSION}/${APP_NAME}-${APP_VERSION}-docs.tar.gz"
git push "https://project_${CI_PROJECT_ID}_bot:${RELEASE_TOKEN}@gitlab.com/${CI_PROJECT_PATH}.git" "HEAD:${CI_COMMIT_REF_NAME}" "refs/tags/v${APP_VERSION}"
fi
artifacts:
paths:
- artifacts/*
release-gitlab:
image: registry.gitlab.com/gitlab-org/release-cli:latest
dependencies:
- build
stage: release
only:
- tags
- /^v\d+\.\d+\.\d+(-\w+)?$/
script:
- release-cli create \
--name "Release ${APP_NAME} ${APP_VERSION}" \
--description "./CHANGELOG.md" \
--tag-name "v${APP_VERSION}" \
--assets-link "{\"name\":\"${APP_NAME}-${APP_VERSION}.tar.gz\",\"url\":\"${PACKAGE_REGISTRY_URL}/${APP_NAME}/${APP_VERSION}/${APP_NAME}-${APP_VERSION}.tar.gz\"}" \
--assets-link "{\"name\":\"${APP_NAME}-${APP_VERSION}-docs.tar.gz\",\"url\":\"${PACKAGE_REGISTRY_URL}/${APP_NAME}/${APP_VERSION}/${APP_NAME}-${APP_VERSION}-docs.tar.gz\"}"
release-hex:
image: elixir:latest
dependencies:
- build
stage: release
only:
- tags
- /^v\d+\.\d+\.\d+(-\w+)?$/
script:
- mix hex.publish --yes

2
.tool-versions Normal file
View file

@ -0,0 +1,2 @@
erlang 27.0.1
elixir 1.17.2

View file

@ -1,28 +1,44 @@
# Vivid.PNG
Vivid.PNG adds PNG generating support to [Vivid](https://hex.pm/packages/vivid),
[![Build Status](https://drone.harton.dev/api/badges/james/vivid_png/status.svg?ref=refs/heads/main)](https://drone.harton.dev/james/vivid_png)
[![Hex.pm](https://img.shields.io/hexpm/v/vivid_png.svg)](https://hex.pm/packages/vivid_png)
`Vivid.PNG` adds PNG generating support to [Vivid](https://hex.pm/packages/vivid),
a 2D rendering library implemented 100% in Elixir with no dependencies.
## Accessing on GitHub
This repository is [mirrored to GitHub](https://github.com/jimsynz/vivid_png.ex) from it's home on [harton.dev](https://harton.dev/james/vivid_png). Feel free to raise issues, etc, on GitHub.
## Installation
[Available in Hex](https://hex.pm/packages/vivid_png), the package can be installed
by adding `vivid_png` to your list of dependencies in `mix.exs`:
`Vivid.PNG` is [available in Hex](https://hex.pm/packages/vivid_png), the
package can be installed by adding `vivid_png` to your list of dependencies in
`mix.exs`:
```elixir
def deps do
[{:vivid_png, "~> 0.2.0"}]
[
{:vivid_png, "~> 0.2.0"}
]
end
```
Documentation for the latest release can be found on
[HexDocs](https://hexdocs.pm/vivid_png) and for the `main` branch on
[docs.harton.nz](https://docs.harton.nz/james/vivid_png).
## Github Mirror
This repository is mirrored [on Github](https://github.com/jimsynz/vivid_png)
from it's primary location [on my Forgejo instance](https://harton.dev/james/vivid_png).
Feel free to raise issues and open PRs on Github.
## License
Source code is licensed under the terms of the MIT license, the text of which
is included in the `LICENSE` file in this distribution.
## Documentation
Documentations can be found at [https://hexdocs.pm/vivid_png](https://hexdocs.pm/vivid_png).
## Status
```elixir
@ -44,4 +60,4 @@ frame
|> PNG.to_png("example.png")
```
![example.png](https://raw.githubusercontent.com/jamesotron/vivid_png.ex/master/example.png)
![example.png](https://harton.dev/james/vivid_png/raw/branch/main/example.png)

View file

@ -3,7 +3,7 @@ import Config
config :git_ops,
mix_project: Mix.Project.get!(),
changelog_file: "CHANGELOG.md",
repository_url: "https://gitlab.com/***PROJECT_PATH***",
repository_url: "https://harton.dev/james/vivid_png",
manage_mix_version?: true,
manage_readme_version: "README.md",
version_tag_prefix: "v"

View file

@ -13,8 +13,7 @@ defimpl Vivid.PNG, for: Vivid.Buffer do
with {:ok, file} <- File.open(path, [:write]),
png <- create_png(buffer, file),
:ok <- :png.close(png),
:ok <- File.close(file),
do: :ok
do: File.close(file)
end
defp config(%Buffer{rows: height, columns: width}, file) do
@ -33,7 +32,7 @@ defimpl Vivid.PNG, for: Vivid.Buffer do
buffer
|> Stream.map(&colour_to_binary(&1))
|> Stream.chunk(width)
|> Stream.chunk_every(width)
|> Stream.map(&Enum.join(&1))
|> Enum.reverse()
|> Enum.reduce(png, &:png.append(&2, {:row, &1}))

27
mix.exs
View file

@ -1,4 +1,5 @@
defmodule Vivid.PNG.Mixfile do
@moduledoc false
use Mix.Project
@version "0.2.0"
@ -12,7 +13,12 @@ defmodule Vivid.PNG.Mixfile do
build_embedded: Mix.env() == :prod,
start_permanent: Mix.env() == :prod,
package: package(),
deps: deps()
deps: deps(),
source_url: "https://harton.dev/james/vivid_png",
homepage_url: "https://harton.dev/james/vivid_png",
docs: [
extras: ["README.md", "CHANGELOG.md"]
]
]
end
@ -31,17 +37,26 @@ defmodule Vivid.PNG.Mixfile do
maintainers: ["James Harton <james@harton.nz>"],
licenses: ["MIT"],
links: %{
"Source" => "https://gitlab.com/jimsy/vivid_png.ex"
"Source" => "https://harton.dev/james/vivid_png",
"GitHub" => "https://github.com/jimsynz/vivid_png",
"Changelog" => "https://docs.harton.nz/james/vivid_png/changelog.html",
"Sponsor" => "https://github.com/sponsors/jimsynz"
}
]
end
defp deps do
devtestopts = [only: ~w[dev test]a, runtime: false]
[
{:ex_doc, ">= 0.0.0", only: ~w[dev test]a},
{:credo, "~> 1.1", only: ~w[dev test]a, runtime: false},
{:git_ops, "~> 2.3", only: ~w[dev test]a, runtime: false},
{:png, "~> 0.1"},
{:credo, "~> 1.6", devtestopts},
{:dialyxir, "~> 1.3", devtestopts},
{:doctor, "~> 0.21.0", devtestopts},
{:ex_check, "~> 0.16.0", devtestopts},
{:ex_doc, ">= 0.28.1", devtestopts},
{:git_ops, "~> 2.4", devtestopts},
{:mix_audit, "~> 2.1", devtestopts},
{:png, "~> 0.2"},
{:vivid, "~> 0.4"}
]
end

View file

@ -1,16 +1,24 @@
%{
"bunt": {:hex, :bunt, "0.2.0", "951c6e801e8b1d2cbe58ebbd3e616a869061ddadcc4863d0a2182541acae9a38", [:mix], [], "hexpm", "7af5c7e09fe1d40f76c8e4f9dd2be7cebd83909f31fee7cd0e9eadc567da8353"},
"credo": {:hex, :credo, "1.5.4", "9914180105b438e378e94a844ec3a5088ae5875626fc945b7c1462b41afc3198", [:mix], [{:bunt, "~> 0.2.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2.8", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "cf51af45eadc0a3f39ba13b56fdac415c91b34f7b7533a13dc13550277141bc4"},
"earmark": {:hex, :earmark, "1.3.2", "b840562ea3d67795ffbb5bd88940b1bed0ed9fa32834915125ea7d02e35888a5", [:mix], [], "hexpm", "e3be2bc3ae67781db529b80aa7e7c49904a988596e2dbff897425b48b3581161"},
"earmark_parser": {:hex, :earmark_parser, "1.4.12", "b245e875ec0a311a342320da0551da407d9d2b65d98f7a9597ae078615af3449", [:mix], [], "hexpm", "711e2cc4d64abb7d566d43f54b78f7dc129308a63bc103fbd88550d2174b3160"},
"ex_doc": {:hex, :ex_doc, "0.23.0", "a069bc9b0bf8efe323ecde8c0d62afc13d308b1fa3d228b65bca5cf8703a529d", [:mix], [{:earmark_parser, "~> 1.4.0", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}], "hexpm", "f5e2c4702468b2fd11b10d39416ddadd2fcdd173ba2a0285ebd92c39827a5a16"},
"file_system": {:hex, :file_system, "0.2.10", "fb082005a9cd1711c05b5248710f8826b02d7d1784e7c3451f9c1231d4fc162d", [:mix], [], "hexpm", "41195edbfb562a593726eda3b3e8b103a309b733ad25f3d642ba49696bf715dc"},
"bunt": {:hex, :bunt, "1.0.0", "081c2c665f086849e6d57900292b3a161727ab40431219529f13c4ddcf3e7a44", [:mix], [], "hexpm", "dc5f86aa08a5f6fa6b8096f0735c4e76d54ae5c9fa2c143e5a1fc7c1cd9bb6b5"},
"credo": {:hex, :credo, "1.7.7", "771445037228f763f9b2afd612b6aa2fd8e28432a95dbbc60d8e03ce71ba4446", [:mix], [{:bunt, "~> 0.2.1 or ~> 1.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2 or ~> 1.0", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "8bc87496c9aaacdc3f90f01b7b0582467b69b4bd2441fe8aae3109d843cc2f2e"},
"decimal": {:hex, :decimal, "2.1.1", "5611dca5d4b2c3dd497dec8f68751f1f1a54755e8ed2a966c2633cf885973ad6", [:mix], [], "hexpm", "53cfe5f497ed0e7771ae1a475575603d77425099ba5faef9394932b35020ffcc"},
"dialyxir": {:hex, :dialyxir, "1.4.3", "edd0124f358f0b9e95bfe53a9fcf806d615d8f838e2202a9f430d59566b6b53b", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "bf2cfb75cd5c5006bec30141b131663299c661a864ec7fbbc72dfa557487a986"},
"doctor": {:hex, :doctor, "0.21.0", "20ef89355c67778e206225fe74913e96141c4d001cb04efdeba1a2a9704f1ab5", [:mix], [{:decimal, "~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}], "hexpm", "a227831daa79784eb24cdeedfa403c46a4cb7d0eab0e31232ec654314447e4e0"},
"earmark_parser": {:hex, :earmark_parser, "1.4.41", "ab34711c9dc6212dda44fcd20ecb87ac3f3fce6f0ca2f28d4a00e4154f8cd599", [:mix], [], "hexpm", "a81a04c7e34b6617c2792e291b5a2e57ab316365c2644ddc553bb9ed863ebefa"},
"erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"},
"ex_check": {:hex, :ex_check, "0.16.0", "07615bef493c5b8d12d5119de3914274277299c6483989e52b0f6b8358a26b5f", [:mix], [], "hexpm", "4d809b72a18d405514dda4809257d8e665ae7cf37a7aee3be6b74a34dec310f5"},
"ex_doc": {:hex, :ex_doc, "0.34.2", "13eedf3844ccdce25cfd837b99bea9ad92c4e511233199440488d217c92571e8", [:mix], [{:earmark_parser, "~> 1.4.39", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.0", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14 or ~> 1.0", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1 or ~> 1.0", [hex: :makeup_erlang, repo: "hexpm", optional: false]}, {:makeup_html, ">= 0.1.0", [hex: :makeup_html, repo: "hexpm", optional: true]}], "hexpm", "5ce5f16b41208a50106afed3de6a2ed34f4acfd65715b82a0b84b49d995f95c1"},
"file_system": {:hex, :file_system, "1.0.0", "b689cc7dcee665f774de94b5a832e578bd7963c8e637ef940cd44327db7de2cd", [:mix], [], "hexpm", "6752092d66aec5a10e662aefeed8ddb9531d79db0bc145bb8c40325ca1d8536d"},
"git_cli": {:hex, :git_cli, "0.3.0", "a5422f9b95c99483385b976f5d43f7e8233283a47cda13533d7c16131cb14df5", [:mix], [], "hexpm", "78cb952f4c86a41f4d3511f1d3ecb28edb268e3a7df278de2faa1bd4672eaf9b"},
"git_ops": {:hex, :git_ops, "2.3.0", "a77f91b810d874e1abf5f415f335959a2dfc3613cbcd28c7c05b97c666339fda", [:mix], [{:git_cli, "~> 0.2", [hex: :git_cli, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "849bd53b7992963b3fdfebcdd0c946f4aab3f6ffbcfa5668b3e83cd5aeca0a2f"},
"jason": {:hex, :jason, "1.2.2", "ba43e3f2709fd1aa1dce90aaabfd039d000469c05c56f0b8e31978e03fa39052", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "18a228f5f0058ee183f29f9eae0805c6e59d61c3b006760668d8d18ff0d12179"},
"makeup": {:hex, :makeup, "1.0.5", "d5a830bc42c9800ce07dd97fa94669dfb93d3bf5fcf6ea7a0c67b2e0e4a7f26c", [:mix], [{:nimble_parsec, "~> 0.5 or ~> 1.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "cfa158c02d3f5c0c665d0af11512fed3fba0144cf1aadee0f2ce17747fba2ca9"},
"makeup_elixir": {:hex, :makeup_elixir, "0.15.0", "98312c9f0d3730fde4049985a1105da5155bfe5c11e47bdc7406d88e01e4219b", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.1", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "75ffa34ab1056b7e24844c90bfc62aaf6f3a37a15faa76b07bc5eba27e4a8b4a"},
"nimble_parsec": {:hex, :nimble_parsec, "1.1.0", "3a6fca1550363552e54c216debb6a9e95bd8d32348938e13de5eda962c0d7f89", [:mix], [], "hexpm", "08eb32d66b706e913ff748f11694b17981c0b04a33ef470e33e11b3d3ac8f54b"},
"git_ops": {:hex, :git_ops, "2.6.1", "cc7799a68c26cf814d6d1a5121415b4f5bf813de200908f930b27a2f1fe9dad5", [:mix], [{:git_cli, "~> 0.2", [hex: :git_cli, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "ce62d07e41fe993ec22c35d5edb11cf333a21ddaead6f5d9868fcb607d42039e"},
"jason": {:hex, :jason, "1.4.3", "d3f984eeb96fe53b85d20e0b049f03e57d075b5acda3ac8d465c969a2536c17b", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "9a90e868927f7c777689baa16d86f4d0e086d968db5c05d917ccff6d443e58a3"},
"makeup": {:hex, :makeup, "1.1.2", "9ba8837913bdf757787e71c1581c21f9d2455f4dd04cfca785c70bbfff1a76a3", [], [{:nimble_parsec, "~> 1.2.2 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "cce1566b81fbcbd21eca8ffe808f33b221f9eee2cbc7a1706fc3da9ff18e6cac"},
"makeup_elixir": {:hex, :makeup_elixir, "0.16.2", "627e84b8e8bf22e60a2579dad15067c755531fea049ae26ef1020cad58fe9578", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "41193978704763f6bbe6cc2758b84909e62984c7752b3784bd3c218bb341706b"},
"makeup_erlang": {:hex, :makeup_erlang, "1.0.0", "6f0eff9c9c489f26b69b61440bf1b238d95badae49adac77973cbacae87e3c2e", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "ea7a9307de9d1548d2a72d299058d1fd2339e3d398560a0e46c27dab4891e4d2"},
"mix_audit": {:hex, :mix_audit, "2.1.4", "0a23d5b07350cdd69001c13882a4f5fb9f90fbd4cbf2ebc190a2ee0d187ea3e9", [:make, :mix], [{:jason, "~> 1.4", [hex: :jason, repo: "hexpm", optional: false]}, {:yaml_elixir, "~> 2.11", [hex: :yaml_elixir, repo: "hexpm", optional: false]}], "hexpm", "fd807653cc8c1cada2911129c7eb9e985e3cc76ebf26f4dd628bb25bbcaa7099"},
"nimble_parsec": {:hex, :nimble_parsec, "1.4.0", "51f9b613ea62cfa97b25ccc2c1b4216e81df970acd8e16e8d1bdc58fef21370d", [:mix], [], "hexpm", "9c565862810fb383e9838c1dd2d7d2c437b3d13b267414ba6af33e50d2d1cf28"},
"png": {:hex, :png, "0.2.1", "b25c17c8dcdc40096d46ae2d7c2777c63fede48fa8c8312cc708c88554049d3b", [:rebar3], [], "hexpm", "279345e07108c604871a21f1c91f716810ab559af2b20d6f302e0a98265ef72e"},
"vivid": {:hex, :vivid, "0.4.3", "ea0abddb41a1ac778392c05f11c70118a5d36d71f0dee9e4b10bcb757a54f1c2", [:mix], [], "hexpm", "60195f5bb21d22acd2691cf01d4cc6809815b9c0cd369740d48ec9af8ddcfdf3"},
"vivid": {:hex, :vivid, "0.4.4", "5e94dade1791c8f57b59210b729737553fbf81c15fa9a7b820a7a86e01b19297", [:mix], [], "hexpm", "8245b253564cbf8e90acec4b702a3659938661793628b535f58419cba854c1ed"},
"yamerl": {:hex, :yamerl, "0.10.0", "4ff81fee2f1f6a46f1700c0d880b24d193ddb74bd14ef42cb0bcf46e81ef2f8e", [:rebar3], [], "hexpm", "346adb2963f1051dc837a2364e4acf6eb7d80097c0f53cbdc3046ec8ec4b4e6e"},
"yaml_elixir": {:hex, :yaml_elixir, "2.11.0", "9e9ccd134e861c66b84825a3542a1c22ba33f338d82c07282f4f1f52d847bd50", [:mix], [{:yamerl, "~> 0.10", [hex: :yamerl, repo: "hexpm", optional: false]}], "hexpm", "53cc28357ee7eb952344995787f4bb8cc3cecbf189652236e9b163e8ce1bc242"},
}

6
renovate.json Normal file
View file

@ -0,0 +1,6 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"local>renovate/renovate"
]
}