Skip to content

Commit

Permalink
Merge branch 'master' into feature/automatic-index-collection
Browse files Browse the repository at this point in the history
  • Loading branch information
SleeplessByte authored Aug 7, 2023
2 parents 82fd765 + f98dfd7 commit 15d83fb
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 14 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/publish-bookworm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Publish debian bookworm packages

on:
- workflow_dispatch

jobs:
publish-bookworm:
runs-on: ubuntu-latest
container:
image: debian:bookworm
steps:
- uses: actions/checkout@v3
name: Check out repository
- name: Install repo
run: apt-get update && DEBIAN_FRONTEND=noninteractive apt-get --yes install wget && wget -O key.deb https://deb1.ws.maxmaton.nl/key.deb && DEBIAN_FRONTEND=noninteractive apt-get --yes install ./key.deb && echo "deb [signed-by=/usr/share/keyrings/maxmaton.gpg] http://deb.maxmaton.nl/debian bookworm main non-free" > /etc/apt/sources.list.d/maxmaton.list
- name: Install dependencies
run: apt-get update && DEBIAN_FRONTEND=noninteractive apt-get --yes install build-essential gem scrypt sshpass gem2deb ruby-actionpack ruby-activesupport ruby-media-types
- name: Build gem
run: |
sed -i -re "s/VERSION\s+=\s+'([0-9]+.[0-9]+.[0-9]+)'/VERSION = '\1.bookworm'/g" lib/media_types/version.rb
gem build media_types.gemspec
- name: Build deb
run: [email protected] gem2deb media_types-*.gem && ls -hal
- name: Publish
env:
PUBLISH_SIGNING_KEY: ${{ secrets.PUBLISH_SIGNING_KEY }}
SSHPASS: ${{ secrets.SSHPASS }}
run: |
echo "deb1.ws.maxmaton.nl ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDgN3TiyKvRTj4xBSyQtYz0OuHZYv2i+x3NL+svh2k0SgPr0Xms4Vu+g3AXntXUQGRM0W9zbcZSHiBIWbliv3Y+20f7lKlj9uXUEMHDuiB7Fu7dXObfHswIvTX3XWiPdDeG1jYQbGM3tENX/wtEoixyL++33O69t2SFR5MkPk+/j+zlGLCFf0ypTAMb7bT5NjRNM3+v0LT2WVSZuawA7Fl8WBVTq7MSSuCZIxHIv1kEq6AWpOjWZHNVZrijs+uRTIPcrZ47wSt6tanjAnWT9sAzu8KqcvQsPw9IQwqV1nfQWz0wMit7ijn9B3MrkNHXP5PaNiZQCezsbrh9glhShz0z" > known_hosts
echo "deb1.ws.maxmaton.nl ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBMr5uAraiRj0pQ9Q9dQO0xMosTzFUAe+VjtMclIUbdJ7r7XMUa3etxh3BfBlW4nq3ZdIFCsV2zwzTaYSmfh95Xs=" >> known_hosts
echo "deb1.ws.maxmaton.nl ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPhQl7Ik6h7hSQbdo9ZfF78WYFCzch8SAOXFBxxAZH06" >> known_hosts
echo "Uploading :" ruby-media-types_*.deb
scrypt enc --passphrase "env:PUBLISH_SIGNING_KEY" ruby-media-types_*.deb | sshpass -e ssh -o "UserKnownHostsFile=known_hosts" [email protected] "echo 'uploading bookworm' && sudo /opt/max/publish-deb ruby-media-types bookworm main && echo 'bookworm done'"
33 changes: 33 additions & 0 deletions .github/workflows/publish-sid.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Publish debian sid packages

on:
- workflow_dispatch

jobs:
publish-sid:
runs-on: ubuntu-latest
container:
image: debian:sid
steps:
- uses: actions/checkout@v3
name: Check out repository
- name: Install repo
run: apt-get update && DEBIAN_FRONTEND=noninteractive apt-get --yes install wget && wget -O key.deb https://deb1.ws.maxmaton.nl/key.deb && DEBIAN_FRONTEND=noninteractive apt-get --yes install ./key.deb && echo "deb [signed-by=/usr/share/keyrings/maxmaton.gpg] http://deb.maxmaton.nl/debian sid main non-free" > /etc/apt/sources.list.d/maxmaton.list
- name: Install dependencies
run: apt-get update && DEBIAN_FRONTEND=noninteractive apt-get --yes install build-essential gem scrypt sshpass gem2deb ruby-actionpack ruby-activesupport ruby-media-types
- name: Build gem
run: |
sed -i -re "s/VERSION\s+=\s+'([0-9]+.[0-9]+.[0-9]+)'/VERSION = '\1.sid'/g" lib/media_types/version.rb
gem build media_types.gemspec
- name: Build deb
run: [email protected] gem2deb media_types-*.gem && ls -hal
- name: Publish
env:
PUBLISH_SIGNING_KEY: ${{ secrets.PUBLISH_SIGNING_KEY }}
SSHPASS: ${{ secrets.SSHPASS }}
run: |
echo "deb1.ws.maxmaton.nl ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDgN3TiyKvRTj4xBSyQtYz0OuHZYv2i+x3NL+svh2k0SgPr0Xms4Vu+g3AXntXUQGRM0W9zbcZSHiBIWbliv3Y+20f7lKlj9uXUEMHDuiB7Fu7dXObfHswIvTX3XWiPdDeG1jYQbGM3tENX/wtEoixyL++33O69t2SFR5MkPk+/j+zlGLCFf0ypTAMb7bT5NjRNM3+v0LT2WVSZuawA7Fl8WBVTq7MSSuCZIxHIv1kEq6AWpOjWZHNVZrijs+uRTIPcrZ47wSt6tanjAnWT9sAzu8KqcvQsPw9IQwqV1nfQWz0wMit7ijn9B3MrkNHXP5PaNiZQCezsbrh9glhShz0z" > known_hosts
echo "deb1.ws.maxmaton.nl ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBMr5uAraiRj0pQ9Q9dQO0xMosTzFUAe+VjtMclIUbdJ7r7XMUa3etxh3BfBlW4nq3ZdIFCsV2zwzTaYSmfh95Xs=" >> known_hosts
echo "deb1.ws.maxmaton.nl ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPhQl7Ik6h7hSQbdo9ZfF78WYFCzch8SAOXFBxxAZH06" >> known_hosts
echo "Uploading :" ruby-media-types_*.deb
scrypt enc --passphrase "env:PUBLISH_SIGNING_KEY" ruby-media-types_*.deb | sshpass -e ssh -o "UserKnownHostsFile=known_hosts" [email protected] "echo 'uploading sid' && sudo /opt/max/publish-deb ruby-media-types sid main && echo 'sid done'"
28 changes: 14 additions & 14 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
## 2.2.0

- Add ability to define multiple versions using one block.
- Added ability to mark certain attributes as optional when validating with `loose: true` and required otherwise.
- Added `index` attribute type that automatically generates a link list compatible with media_types-serialization.
- Added support for `collection` to automatically look up a previously defined schema when passing a view.
- Add `index` attribute type that automatically generates a link list compatible with media_types-serialization.
- Add support for `collection` to automatically look up a previously defined schema when passing a view.
- Add ability to mark certain attributes as optional when validating with `loose: true` and required otherwise.

## 2.1.1

Expand All @@ -24,25 +24,25 @@

## 2.0.0

- Removed ability to set default suffix. All suffixes now default to `+json`.
- Remove ability to set default suffix. All suffixes now default to `+json`.
- Suffixes are now set for a given view and version instead of as a block.
- Added `suffix :yoursuffix` command to override the default `:json` suffix.
- Removed defaults block.
- Removed registrations block.
- Add `suffix :yoursuffix` command to override the default `:json` suffix.
- Remove defaults block.
- Remove registrations block.

## 1.0.0

- Added the ability to do inline tests when defining validations using `assert_pass '<json>'` and `assert_fail '<json>'`.
- Add the ability to do inline tests when defining validations using `assert_pass '<json>'` and `assert_fail '<json>'`.
- `media_type` has been replaced with `use_name`.
- It is no longer possible to set a default version. Please use `version <x> do` instead.
- You no longer need to specify a custom format string. If you set an organisation with `def self.organisation` or set a module wide organisation with `MediaTypes::set_organisation <module>, '<organisation>'` the library will generate identifiers for you.
- `self.base_format` has been replaced by `identifier_format do |type:, view:, version:, suffix:|`.
- Added the `empty` validation to mark an empty object as valid.
- Added the `identifier` function to get the [Media Type Identifier](https://en.wikipedia.org/wiki/Media_type) for the validator.
- Added `version(x)` and `view(x)` functions.
- Added an `available_validations` functions that returns all defined validations.
- Fixed an issue where validations could accidentally merge if defined with a bad `base_format`.
- Fixed an issue where undefined validations would accept an empty object.
- Add the `empty` validation to mark an empty object as valid.
- Add the `identifier` function to get the [Media Type Identifier](https://en.wikipedia.org/wiki/Media_type) for the validator.
- Add `version(x)` and `view(x)` functions.
- Add an `available_validations` functions that returns all defined validations.
- Fix an issue where validations could accidentally merge if defined with a bad `base_format`.
- Fix an issue where undefined validations would accept an empty object.

## 0.6.2

Expand Down

0 comments on commit 15d83fb

Please sign in to comment.