Skip to content

Commit 15d83fb

Browse files
Merge branch 'master' into feature/automatic-index-collection
2 parents 82fd765 + f98dfd7 commit 15d83fb

File tree

3 files changed

+80
-14
lines changed

3 files changed

+80
-14
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Publish debian bookworm packages
2+
3+
on:
4+
- workflow_dispatch
5+
6+
jobs:
7+
publish-bookworm:
8+
runs-on: ubuntu-latest
9+
container:
10+
image: debian:bookworm
11+
steps:
12+
- uses: actions/checkout@v3
13+
name: Check out repository
14+
- name: Install repo
15+
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
16+
- name: Install dependencies
17+
run: apt-get update && DEBIAN_FRONTEND=noninteractive apt-get --yes install build-essential gem scrypt sshpass gem2deb ruby-actionpack ruby-activesupport ruby-media-types
18+
- name: Build gem
19+
run: |
20+
sed -i -re "s/VERSION\s+=\s+'([0-9]+.[0-9]+.[0-9]+)'/VERSION = '\1.bookworm'/g" lib/media_types/version.rb
21+
gem build media_types.gemspec
22+
- name: Build deb
23+
run: [email protected] gem2deb media_types-*.gem && ls -hal
24+
- name: Publish
25+
env:
26+
PUBLISH_SIGNING_KEY: ${{ secrets.PUBLISH_SIGNING_KEY }}
27+
SSHPASS: ${{ secrets.SSHPASS }}
28+
run: |
29+
echo "deb1.ws.maxmaton.nl ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDgN3TiyKvRTj4xBSyQtYz0OuHZYv2i+x3NL+svh2k0SgPr0Xms4Vu+g3AXntXUQGRM0W9zbcZSHiBIWbliv3Y+20f7lKlj9uXUEMHDuiB7Fu7dXObfHswIvTX3XWiPdDeG1jYQbGM3tENX/wtEoixyL++33O69t2SFR5MkPk+/j+zlGLCFf0ypTAMb7bT5NjRNM3+v0LT2WVSZuawA7Fl8WBVTq7MSSuCZIxHIv1kEq6AWpOjWZHNVZrijs+uRTIPcrZ47wSt6tanjAnWT9sAzu8KqcvQsPw9IQwqV1nfQWz0wMit7ijn9B3MrkNHXP5PaNiZQCezsbrh9glhShz0z" > known_hosts
30+
echo "deb1.ws.maxmaton.nl ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBMr5uAraiRj0pQ9Q9dQO0xMosTzFUAe+VjtMclIUbdJ7r7XMUa3etxh3BfBlW4nq3ZdIFCsV2zwzTaYSmfh95Xs=" >> known_hosts
31+
echo "deb1.ws.maxmaton.nl ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPhQl7Ik6h7hSQbdo9ZfF78WYFCzch8SAOXFBxxAZH06" >> known_hosts
32+
echo "Uploading :" ruby-media-types_*.deb
33+
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'"

.github/workflows/publish-sid.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Publish debian sid packages
2+
3+
on:
4+
- workflow_dispatch
5+
6+
jobs:
7+
publish-sid:
8+
runs-on: ubuntu-latest
9+
container:
10+
image: debian:sid
11+
steps:
12+
- uses: actions/checkout@v3
13+
name: Check out repository
14+
- name: Install repo
15+
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
16+
- name: Install dependencies
17+
run: apt-get update && DEBIAN_FRONTEND=noninteractive apt-get --yes install build-essential gem scrypt sshpass gem2deb ruby-actionpack ruby-activesupport ruby-media-types
18+
- name: Build gem
19+
run: |
20+
sed -i -re "s/VERSION\s+=\s+'([0-9]+.[0-9]+.[0-9]+)'/VERSION = '\1.sid'/g" lib/media_types/version.rb
21+
gem build media_types.gemspec
22+
- name: Build deb
23+
run: [email protected] gem2deb media_types-*.gem && ls -hal
24+
- name: Publish
25+
env:
26+
PUBLISH_SIGNING_KEY: ${{ secrets.PUBLISH_SIGNING_KEY }}
27+
SSHPASS: ${{ secrets.SSHPASS }}
28+
run: |
29+
echo "deb1.ws.maxmaton.nl ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDgN3TiyKvRTj4xBSyQtYz0OuHZYv2i+x3NL+svh2k0SgPr0Xms4Vu+g3AXntXUQGRM0W9zbcZSHiBIWbliv3Y+20f7lKlj9uXUEMHDuiB7Fu7dXObfHswIvTX3XWiPdDeG1jYQbGM3tENX/wtEoixyL++33O69t2SFR5MkPk+/j+zlGLCFf0ypTAMb7bT5NjRNM3+v0LT2WVSZuawA7Fl8WBVTq7MSSuCZIxHIv1kEq6AWpOjWZHNVZrijs+uRTIPcrZ47wSt6tanjAnWT9sAzu8KqcvQsPw9IQwqV1nfQWz0wMit7ijn9B3MrkNHXP5PaNiZQCezsbrh9glhShz0z" > known_hosts
30+
echo "deb1.ws.maxmaton.nl ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBMr5uAraiRj0pQ9Q9dQO0xMosTzFUAe+VjtMclIUbdJ7r7XMUa3etxh3BfBlW4nq3ZdIFCsV2zwzTaYSmfh95Xs=" >> known_hosts
31+
echo "deb1.ws.maxmaton.nl ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPhQl7Ik6h7hSQbdo9ZfF78WYFCzch8SAOXFBxxAZH06" >> known_hosts
32+
echo "Uploading :" ruby-media-types_*.deb
33+
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'"

CHANGELOG.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
## 2.2.0
44

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

1010
## 2.1.1
1111

@@ -24,25 +24,25 @@
2424

2525
## 2.0.0
2626

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

3333
## 1.0.0
3434

35-
- Added the ability to do inline tests when defining validations using `assert_pass '<json>'` and `assert_fail '<json>'`.
35+
- Add the ability to do inline tests when defining validations using `assert_pass '<json>'` and `assert_fail '<json>'`.
3636
- `media_type` has been replaced with `use_name`.
3737
- It is no longer possible to set a default version. Please use `version <x> do` instead.
3838
- 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.
3939
- `self.base_format` has been replaced by `identifier_format do |type:, view:, version:, suffix:|`.
40-
- Added the `empty` validation to mark an empty object as valid.
41-
- Added the `identifier` function to get the [Media Type Identifier](https://en.wikipedia.org/wiki/Media_type) for the validator.
42-
- Added `version(x)` and `view(x)` functions.
43-
- Added an `available_validations` functions that returns all defined validations.
44-
- Fixed an issue where validations could accidentally merge if defined with a bad `base_format`.
45-
- Fixed an issue where undefined validations would accept an empty object.
40+
- Add the `empty` validation to mark an empty object as valid.
41+
- Add the `identifier` function to get the [Media Type Identifier](https://en.wikipedia.org/wiki/Media_type) for the validator.
42+
- Add `version(x)` and `view(x)` functions.
43+
- Add an `available_validations` functions that returns all defined validations.
44+
- Fix an issue where validations could accidentally merge if defined with a bad `base_format`.
45+
- Fix an issue where undefined validations would accept an empty object.
4646

4747
## 0.6.2
4848

0 commit comments

Comments
 (0)