Skip to content

Commit 47f365e

Browse files
Ludo Galabrusmcclellanryanwaitsmefremmax-crawford
authored
fix: add destination to transfer events - release v1.0.2
* chore: stop auto-adding issues to DevTools Project (#170) * fix: enable streaming for in-memory observers (#171) * Squashed commit of the following: commit 9862b71 Author: semantic-release-bot <semantic-release-bot@martynus.net> Date: Thu Sep 7 00:06:39 2023 +0000 chore(release): 1.0.0 [skip ci] ## 1.0.0 (2023-09-07) ### Features * ability to control inclusion of inputs/outputs/proofs/witness ([daf5547](daf5547)) * ability to download hord.sqlite ([3dafa53](3dafa53)) * ability to generate config ([9fda9d0](9fda9d0)) * ability to replay inscriptions ([f1adca9](f1adca9)) * ability to resume ([6c7eaa3](6c7eaa3)) * ability to target blocks ([f6be49e](f6be49e)) * ability to tolerate corrupted data ([adb1b98](adb1b98)) * ability to track updates when scanning bitcoin (+refactor) ([9e54bff](9e54bff)) * ability to update stacks db from cli + fix caching logic ([3ea9f59](3ea9f59)) * add command to check stacks db integrity ([322f473](322f473)) * add get block command to cli ([97de0b0](97de0b0)) * add log, fix ordinal transfers scan ([c4202da](c4202da)) * add logs ([473ddd0](473ddd0)) * add metrics to `/ping` response of event observer server ([#297](https://github.com/hirosystems/ordhook/issues/297)) ([0e1ee7c](0e1ee7c)), closes [#285](#285) * add option to skip chainhook node ping ([a7c0b12](a7c0b12)) * add options for logs ([917090b](917090b)) * add post_transfer_output_value ([4ce0e9e](4ce0e9e)) * add retry ([117e41e](117e41e)) * add shared cache ([07523ae](07523ae)) * add support for bitcoin op DelegatedStacking ([6516155](6516155)) * add transfers table ([db14f60](db14f60)) * always try to initialize tables when starting service ([1a9eddb](1a9eddb)) * attempt to scale up multithreading ([be91202](be91202)) * attempt to support cursed inscriptions ([9b45f90](9b45f90)) * attempt transition to lazy model ([dda0b03](dda0b03)) * batch ingestion, improve cleaning ([168162e](168162e)) * better handling of blessed inscription turning cursed ([f11509a](f11509a)) * cascade changes in CLI interface ([24f27fe](24f27fe)) * cascade hord activation ([42c090b](42c090b)) * chainhook-sdk config niteties ([7d9e179](7d9e179)) * class interface ([9dfec45](9dfec45)) * client draft ([6a6451c](6a6451c)) * complete migration to lazy blocks ([fa50584](fa50584)) * disable certs ([389f77d](389f77d)) * draft naive inscription detection ([9b3e38a](9b3e38a)) * draft ordhook-sdk-js ([b264e72](b264e72)) * draft sha256 verification (wip) ([e6f0619](e6f0619)) * drafting lazy deserialization ([eaa2f71](eaa2f71)) * dry config ([135297e](135297e)) * expose `is_streaming_blocks` prop ([1ba27d7](1ba27d7)) * expose more functions for working with the indexer ([654fead](654fead)) * expose scanning status in GET endpoint ([156c463](156c463)) * expose transfers_pre_inscription ([65afd77](65afd77)) * fetch full bitcoin block, including witness data ([ee9a345](ee9a345)) * fix download block ([38b50df](38b50df)) * handle stacks unconfirmed state scans ([f6d050f](f6d050f)) * handle transfer ([fd5da52](fd5da52)) * HTTP responses adjustments ([51572ef](51572ef)) * implement and document new development flow ([66019a0](66019a0)) * implement zmq runloop ([c6c1c0e](c6c1c0e)) * import inscription parser ([45e0147](45e0147)) * improve cli ergonomics ([991e33f](991e33f)) * improve cli experience ([e865628](e865628)) * improve debug log ([5df77d7](5df77d7)) * improve hord db commands ([21c09c2](21c09c2)) * improve onboarding ([deaa739](deaa739)) * improve ordinal scan efficiency ([e510d4b](e510d4b)) * improve README ([f30e6f4](f30e6f4)) * improve repair command conveniency ([46be0ab](46be0ab)) * improving curse approach ([dcb8054](dcb8054)) * in-house thread pool ([bc5ffdd](bc5ffdd)) * inscription replay speedup ([33a4f8b](33a4f8b)) * introduce check command ([f17dc4c](f17dc4c)) * introduce evaluation reports ([54ad874](54ad874)) * introduce migration script ([8c2b16c](8c2b16c)) * introduce new predicate + refactor schemas ([611c79c](611c79c)) * introduce rocksdb storage for Stacks ([4564e88](4564e88)) * introduce sync command ([ab022e6](ab022e6)) * introduce terminate function ([91616f6](91616f6)) * is_streaming_blocks ([aacf487](aacf487)) * keep 1st tx in cache ([0978a5d](0978a5d)) * logic to start ingestion during indexing ([3c1c99d](3c1c99d)) * merge "inscription_revealed" and "inscription_transferred" into "inscription_feed" ([741290d](741290d)) * migrate stacks scans to rocksdb ([4408b1e](4408b1e)) * migration to rocksdb, moving json parsing from networking thread ([5ad0147](5ad0147)) * move thread pool size to config ([bc313fa](bc313fa)) * multithread traversals ([fba5c89](fba5c89)) * number of retries for 4 to 3 ([b294dff](b294dff)) * optimize memory ([5db1531](5db1531)) * optimize replay ([be26dac](be26dac)) * ordinal inscription_transfer code complete ([f55a5ee](f55a5ee)) * plug inscription processing in ibd ([df36617](df36617)) * plumbing for ordhook-sdk-js ([7487589](7487589)) * polish `hord find sat_point` command ([d071484](d071484)) * polish first impression ([3c2b00c](3c2b00c)) * predicate schemas ([198cdaa](198cdaa)) * prototype warmup ([fa6c86f](fa6c86f)) * re-approach stacks block commit schema ([218d599](218d599)) * re-implement satoshi overflows handling ([8ea5bdf](8ea5bdf)) * re-introduce ingestion ([71c90d7](71c90d7)) * restore ability to replay transfers ([98e7e9b](98e7e9b)) * return enable in api ([f39259c](f39259c)) * return local result when known ([5441851](5441851)) * revisit caching strategy ([2705b95](2705b95)) * revisit threading model ([05b6d5c](05b6d5c)) * scan inscription revealed ([84c5a0c](84c5a0c)) * scan inscription revealed ([644d515](644d515)) * share traversals_cache over 10 blocks spans ([b0378c3](b0378c3)) * simplify + improve coordination ([1922fd9](1922fd9)) * start investigating zmq signaling ([0ec2653](0ec2653)) * streamline processors ([13421db](13421db)) * support cursed inscriptions in chainhook client ([d7cc5a4](d7cc5a4)) * support for latest archives, add logs ([494cf3c](494cf3c)) * tweak mmap / page_size values ([5316a57](5316a57)) * update chainhook-sdk ([f052e08](f052e08)) * update inscription transfer logic ([9d0d106](9d0d106)) * update inscription transfer schemas ([f80e983](f80e983)) * upgrade `service start` implementation + documentation ([02db65e](02db65e)) * use caching on streamed blocks ([784e9a0](784e9a0)) * use thread pools for scans ([45b9abd](45b9abd)) * zmq sockets ([d2e328a](d2e328a)) ### Bug Fixes * ability to run without redis ([96825c3](96825c3)) * add busy handler ([d712e0d](d712e0d)) * add exp backoff ([f014c14](f014c14)) * add retry logic in rocksdb ([247df20](247df20)) * add retry logic to work around unexpected responses from bitcoind ([2ab6b32](2ab6b32)) * additional adjustments ([fe26063](fe26063)) * additional fixes (network, address, offsets) ([8006000](8006000)) * address build warnings ([dc623a0](dc623a0)) * address non-inscribed block case ([a7d08a3](a7d08a3)) * address redis disconnects ([a6b4a5f](a6b4a5f)) * address remaining issues ([74b2fa9](74b2fa9)) * adjust error message ([3e7b0d0](3e7b0d0)) * allow empty block ([fe8ce45](fe8ce45)) * always fetch blocks ([97060a1](97060a1)) * async/await regression ([676aac1](676aac1)) * attempt ([9e14fce](9e14fce)) * attempt to fix offset ([e6c5d0e](e6c5d0e)) * attempt to retrieve blocks from iterator ([f718071](f718071)) * attempt to tweak rocksdb ([11b9b6b](11b9b6b)) * auto enable stacks predicate ([30557f8](30557f8)) * backpressure on traversals ([3177e22](3177e22)) * batch inscription ([cd1085c](cd1085c)) * batch migration ([ed8b7ad](ed8b7ad)) * better redis error handling ([debb06c](debb06c)) * better support of reinscriptions ([a1410e2](a1410e2)) * better termination ([8a5482c](8a5482c)) * binary name ([4950a50](4950a50)) * block streaming ([dcdfd16](dcdfd16)) * boot sequence ([577f1c2](577f1c2)) * boot sequence, logs, format ([d03f851](d03f851)) * borrow issue ([66e2a7c](66e2a7c)) * broken build ([f0d471e](f0d471e)) * broken test ([239b26a](239b26a)) * broken tests ([2ab6e7d](2ab6e7d)) * build ([4067f08](4067f08)) * build ([607ac95](607ac95)) * build error ([d6ed108](d6ed108)) * build error ([bbede8b](bbede8b)) * build error ([fa802fa](fa802fa)) * build error ([44ca74b](44ca74b)) * build error ([053b781](053b781)) * build error ([5c3bcf4](5c3bcf4)) * build error ([b78c0cc](b78c0cc)) * build error ([879ed67](879ed67)) * build errors ([60cd4d0](60cd4d0)) * build errors ([8dd91bf](8dd91bf)) * build errors / merge snafu ([47da0c1](47da0c1)) * build errors + warnings ([938c6df](938c6df)) * build failing ([83f1496](83f1496)) * build warning ([561e51e](561e51e)) * build warning ([75847df](75847df)) * build warning ([0194483](0194483)) * build warnings ([d3e998c](d3e998c)) * build warnings ([e7ad175](e7ad175)) * build warnings ([670bde6](670bde6)) * bump incoming payload limit to 20mb ([7e15086](7e15086)) * cache invalidation ([05bd903](05bd903)) * cache L2 capacity ([e2fbc73](e2fbc73)) * cache size ([ce61205](ce61205)) * cache's ambitions ([e438db7](e438db7)) * Cargo.toml ([759c3a3](759c3a3)) * chain mixup, add logs ([0427a10](0427a10)) * change forking behavior ([4c10014](4c10014)) * clean expectations ([f9e089f](f9e089f)) * clear cache more regularly ([c3b884f](c3b884f)) * command for db patch ([27f6838](27f6838)) * commands doc ([3485e6f](3485e6f)) * compatibility with clarinet ([a282655](a282655)) * condition ([0233dc5](0233dc5)) * create dummy inscription for sats overflow ([84aa6ce](84aa6ce)) * db init command ([55e293b](55e293b)) * decrease compression - from 4 bytes to 8 bytes ([b2eb314](b2eb314)) * deployer predicate wildcard ([05ca395](05ca395)) * disable sleep ([41ecace](41ecace)) * disable steam scan when scanning past blocks ([e2949d2](e2949d2)) * disambiguate inscription_output_value and inscription_fee ([9816cbb](9816cbb)) * do not panic ([a0fa1a9](a0fa1a9)) * doc drift ([b595339](b595339)) * docker build ([df39302](df39302)) * docker file ([6ad5206](6ad5206)) * dockerfile ([73ad612](73ad612)) * dockerfile ([da21ec4](da21ec4)) * documentation drift ([c5335a7](c5335a7)) * documentation drift ([38153ca](38153ca)) * don't early exit when satoshi computing fail ([a8d76b0](a8d76b0)) * don't enable predicate if error ([1274cbf](1274cbf)) * early return ([8f97b56](8f97b56)) * edge case when requests processed in order ([8c4325f](8c4325f)) * edge case when requests processed out of order ([a35cea2](a35cea2)) * edge case when requests processed out of order ([a6651b8](a6651b8)) * enable profiling ([f99b073](f99b073)) * enable specs on reboot ([f23be24](f23be24)) * enforce db reconnection in http endpoints ([bcd2a45](bcd2a45)) * enum serialization ([67cb340](67cb340)) * error management ([f0274f5](f0274f5)) * export all types on ts client ([be8bfbc](be8bfbc)) * failing build ([1502d5d](1502d5d)) * fee ([0337f92](0337f92)) * filter out sat overflows from payloads ([ce439ae](ce439ae)) * gap in stacks scanning ([8c8c5c8](8c8c5c8)) * generator typo ([8a7eddb](8a7eddb)) * handle hint and case of re-inscriptions ([f86b184](f86b184)) * handle non-spending transaction ([cb01eb5](cb01eb5)) * handle re-inscription for unbound inscriptions ([a1ffc1a](a1ffc1a)) * hard coded dev-dependency ([5c105de](5c105de)) * ignore invalid inscription ([f18bc00](f18bc00)) * ignore transaction aborting that we could not classify ([37c80f7](37c80f7)) * implement error handler ([d071b81](d071b81)) * improve progress bar ([b28da56](b28da56)) * improve rewrite block command ([d524771](d524771)) * in-block re-inscription case ([90db9c3](90db9c3)) * include blocks discovered during scan, if any ([1eabce2](1eabce2)) * include ordinals operations in standardized blocks ([a13351d](a13351d)) * include proof on scan commands ([6574008](6574008)) * increase number of retries ([343ddd6](343ddd6)) * indexing ([45661ab](45661ab)) * inject l1 cache hit in results (+ clearing) ([62fd929](62fd929)) * inscription fee ([2ac3022](2ac3022)) * inscription_number ([a7d8153](a7d8153)) * insert new locations ([6475aeb](6475aeb)) * iterate on values ([0c73e62](0c73e62)) * keep trying opening rocksdb conn if failing ([dbc794a](dbc794a)) * lazy block approach ([b567322](b567322)) * leader_registered doc ([f9d7370](f9d7370)) * loading predicates from redis ([3bd308f](3bd308f)) * log level, zeromq dependency ([4a2a6ef](4a2a6ef)) * logic determining start height ([5dd300f](5dd300f)) * logs ([81be24e](81be24e)) * mark inscriber_address as nullable ([77fd88b](77fd88b)) * more pessimism on retries ([9b987c5](9b987c5)) * move parsing back to network thread ([bad1ee6](bad1ee6)) * moving stacks tip ([87c409e](87c409e)) * multithreading cap ([c80ae60](c80ae60)) * myriad of improvements ([0633182](0633182)) * nefarious logs ([3b01a48](3b01a48)) * network, cascade changes ([1f45ec2](1f45ec2)) * off by one ([2a0e75f](2a0e75f)) * off by one ([c31611f](c31611f)) * off by one ([94e1141](94e1141)) * off by one ([abf70e7](abf70e7)) * off by one error ([3832cf9](3832cf9)) * off by one inscriptions number ([cdfbf48](cdfbf48)) * off by one isssue ([fead2ed](fead2ed)) * off by one issue ([a8988ba](a8988ba)) * off by one issue ([155e3a6](155e3a6)) * off by one issue on sats overflow ([8a12004](8a12004)) * off-by-one error in backward traversal ([d4128aa](d4128aa)) * off-by-one in sats number resolution ([42acbeb](42acbeb)) * offset ([278a655](278a655)) * only avoid override for blessed inscriptions ([b50bbc1](b50bbc1)) * optimize reg and dereg ([c2ec1b5](c2ec1b5)) * ordinals scans ([62b62bd](62b62bd)) * outdated dockerfile ([771b036](771b036)) * outdated documentation ([f472a49](f472a49)) * overriden inscriptions ([25c6441](25c6441)) * parsing ([1f047a9](1f047a9)) * patch absence of witness data ([f8fcfca](f8fcfca)) * patch boot latency ([0e3faf9](0e3faf9)) * patch crach ([20d9df6](20d9df6)) * patch db call ([d385df2](d385df2)) * pipeline logic ([a864c85](a864c85)) * pipeline resuming ([06883c6](06883c6)) * ports ([3ee98a8](3ee98a8)) * potential resolve coinbase spent ([5d26738](5d26738)) * PoxInfo default for scan commands ([a00ccf5](a00ccf5)) * predicate documentation ([572cf20](572cf20)) * predicate generator network ([8f0ae21](8f0ae21)) * provide optional values ([2cbf87e](2cbf87e)) * re-apply initial fix ([f5cb516](f5cb516)) * re-arrange logs ([2857d0a](2857d0a)) * re-enable sleep ([0f61a26](0f61a26)) * re-initiate inscriptions connection every 250 blocks ([39671f4](39671f4)) * re-qualify error to warn ([9431684](9431684)) * re-wire cmd ([a1447ad](a1447ad)) * README ([db1d584](db1d584)) * recreate db conn on a regular basis ([81d8575](81d8575)) * redis update ([d4889f1](d4889f1)) * related issue ([4b3a0da](4b3a0da)) * remove rocksdb reconnect ([f2b067e](f2b067e)) * remove sleep ([c371e74](c371e74)) * remove start logic ([a04711a](a04711a)) * remove support for p2wsh inscription reveal support ([4fe71f2](4fe71f2)) * remove symbols ([108117b](108117b)) * remove thread_max * 2 ([359c6f9](359c6f9)) * reopen connect on failures ([3e15da5](3e15da5)) * reply with 500 on payload processing error ([eaa6d7b](eaa6d7b)) * report generation ([0dce12a](0dce12a)) * restore stable values ([fb5c591](fb5c591)) * return blocks to rollback in reverse order ([9fab5a3](9fab5a3)) * reuse existing computation for fix ([222f7c3](222f7c3)) * revert fix, avoid collision in traversals map ([dfcadec](dfcadec)) * revisit log level ([4168661](4168661)) * revisit transfer loop ([1f2151c](1f2151c)) * rocket_okapi version ([2af31a8](2af31a8)) * safer db open, dockerfile ([43d37d7](43d37d7)) * safer error handling ([11509e4](11509e4)) * sat offset computation ([b278b66](b278b66)) * sats overflow handling ([a3f745c](a3f745c)) * schema for curse_type ([72d43c6](72d43c6)) * serialize handlers in one thread ([cdfc264](cdfc264)) * slow down initial configuration ([3096ad3](3096ad3)) * sql query ([1a3bc42](1a3bc42)) * sql query bis ([a479884](a479884)) * sql request ([6345df2](6345df2)) * sql table setup ([c8884a7](c8884a7)) * stack overflow ([aed7d5d](aed7d5d)) * stacks predicate format ([fcf9fb0](fcf9fb0)) * start_block off by one ([b99f7b0](b99f7b0)) * streamline txid handling ([ad48351](ad48351)) * test suite ([c7672f9](c7672f9)) * test warns and errors ([0887d6b](0887d6b)) * threading model ([c9c43ae](c9c43ae)) * threading model ([c2354fc](c2354fc)) * track interrupted scans ([2b51dca](2b51dca)) * transaction type schema ([c35a737](c35a737)) * transfer recomputing commit ([3643636](3643636)) * transfer tracking ([0ea85e3](0ea85e3)) * transfer tracking ([30f299e](30f299e)) * transfer tracking ([0cd29f5](0cd29f5)) * transfer tracking + empty blocks ([dc94875](dc94875)) * traversals algo ([e8ee3ab](e8ee3ab)) * tweak rocksdb options ([a0a6950](a0a6950)) * typo ([b0498bb](b0498bb)) * typo ([baa773f](baa773f)) * unexpected expectation ([7dd362b](7dd362b)) * unify rosetta operation schemas ([bf3216b](bf3216b)) * unused imports ([3aab402](3aab402)) * update chainhook schema ([4e82714](4e82714)) * update inscription_number ([89b94e7](89b94e7)) * update license ([6ebeb77](6ebeb77)) * update rust version in docker build ([fab6f69](fab6f69)) * update spec status ([e268925](e268925)) * update/pin dependencies ([#311](#311)) ([f54b374](f54b374)), closes [#310](#310) * use first input to stick with ord spec interpretation / implementation ([206678f](206678f)) * use rpc instead of rest ([1b18818](1b18818)) * zeromq, subsidy issue ([dbca70c](dbca70c)) ### Reverts * Revert "chore: tmp patch" ([3e022ca](3e022ca)) commit 4ef18d5 Merge: d111c44 4cde5e8 Author: Scott McClellan <scott.mcclellan@gmail.com> Date: Wed Sep 6 18:44:26 2023 -0500 Merge pull request #168 from hirosystems/develop Merge up `develop` to `main` * fix: CI rust version mismatch, create empty db (#173) * fix: create db if does not exists * chore: update rust version * chore: bump version to 1.0.1 * fix: service boot sequence (#175) * fix: ci * fix: initial flow (#178) * chore: update chainhook-sdk + cascade changes * fix: update archive url * feat: only create rocksdb if sqlite present * fix: use crossbeam channel instead of std * fix: improve error message * doc: update README * fix: build warnings * fix: block_archiving expiration * fix: archive url * fix: read content len from http header * chore: untar sqlite file * chore: bump versions * fix: build error / warning * change title (#182) * Ordhook doc updates (#183) * update copy * add openapi reference file to ordhook docs for better context * typo in reference link for bitcoind * remove references to chainhook * break out guides for scanning and streaming ordinal activities * fix references to Ordhook.toml * update content for each guide * replace mentions of Chainhook --------- Co-authored-by: Max Efremov <51917427+mefrem@users.noreply.github.com> * provide a pointer to rust installation and a next steps linking to guides (#184) * update Ordhook.toml (#185) * fix: grammar tweaks grammar tweaks * fix: grammar tweaks Grammar tweaks * fix: grammar updates grammar updates Co-authored-by: Ludo Galabru <ludo@hiro.so> * doc: update getting-started Co-authored-by: Ludo Galabru <ludo@hiro.so> * doc: update overview.md Updated grammar Co-authored-by: Ludo Galabru <ludo@hiro.so> * feat: ordhook-sdk-js refactoring (#186) --------- Co-authored-by: Scott McClellan <scott.mcclellan@gmail.com> Co-authored-by: Ryan <ryan.waits@gmail.com> Co-authored-by: Max Efremov <51917427+mefrem@users.noreply.github.com> Co-authored-by: max-crawford <102705427+max-crawford@users.noreply.github.com>
1 parent ac3915f commit 47f365e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+6714
-9317
lines changed

.github/workflows/ci.yaml

+163-19
Original file line numberDiff line numberDiff line change
@@ -4,36 +4,58 @@ on:
44
push:
55
branches:
66
- develop
7-
- main
8-
tags-ignore:
9-
- "**"
7+
- feat/ordhook-sdk-js
108
paths-ignore:
11-
- "**/CHANGELOG.md"
9+
- '**/CHANGELOG.md'
1210
pull_request:
1311
workflow_dispatch:
1412

13+
concurrency:
14+
group: ${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}
15+
cancel-in-progress: true
16+
1517
jobs:
16-
build-publish:
18+
test:
1719
runs-on: ubuntu-latest
1820
steps:
19-
- uses: actions/checkout@v2
21+
- uses: actions/checkout@v4
2022
with:
21-
token: ${{ secrets.GH_TOKEN || secrets.GITHUB_TOKEN }}
22-
fetch-depth: 0
2323
persist-credentials: false
2424

25+
- name: Cache cargo
26+
uses: actions/cache@v3
27+
with:
28+
path: |
29+
~/.cargo/bin/
30+
~/.cargo/registry/index/
31+
~/.cargo/registry/cache/
32+
~/.cargo/git/db/
33+
target/
34+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
35+
2536
- name: Cargo test
2637
run: |
2738
rustup update
28-
cargo test --all
39+
RUST_BACKTRACE=1 cargo test --all -- --test-threads=1
40+
41+
build-publish:
42+
runs-on: ubuntu-latest
43+
needs: test
44+
outputs:
45+
docker_image_digest: ${{ steps.docker_push.outputs.digest }}
46+
new_release_published: ${{ steps.semantic.outputs.new_release_published }}
47+
steps:
48+
- uses: actions/checkout@v4
49+
with:
50+
persist-credentials: false
2951

3052
- name: Semantic Release
31-
uses: cycjimmy/semantic-release-action@v3
53+
uses: cycjimmy/semantic-release-action@v4
3254
id: semantic
3355
# Only run on non-PR events or only PRs that aren't from forks
3456
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
3557
env:
36-
GITHUB_TOKEN: ${{ secrets.GH_TOKEN || secrets.GITHUB_TOKEN }}
58+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3759
SEMANTIC_RELEASE_PACKAGE: ${{ github.event.repository.name }}
3860
with:
3961
semantic_version: 19
@@ -42,15 +64,21 @@ jobs:
4264
@semantic-release/git@10.0.1
4365
conventional-changelog-conventionalcommits@6.1.0
4466
67+
- name: Checkout tag
68+
if: steps.semantic.outputs.new_release_version != ''
69+
uses: actions/checkout@v4
70+
with:
71+
persist-credentials: false
72+
ref: v${{ steps.semantic.outputs.new_release_version }}
73+
4574
- name: Set up Docker Buildx
46-
uses: docker/setup-buildx-action@v1
75+
uses: docker/setup-buildx-action@v3
4776

4877
- name: Docker Meta
4978
id: meta
50-
uses: docker/metadata-action@v4
79+
uses: docker/metadata-action@v5
5180
with:
5281
images: |
53-
blockstack/${{ github.event.repository.name }}
5482
hirosystems/${{ github.event.repository.name }}
5583
tags: |
5684
type=ref,event=branch
@@ -59,18 +87,134 @@ jobs:
5987
type=semver,pattern={{major}}.{{minor}},value=${{ steps.semantic.outputs.new_release_version }},enable=${{ steps.semantic.outputs.new_release_version != '' }}
6088
type=raw,value=latest,enable={{is_default_branch}}
6189
62-
- name: Login to DockerHub
63-
uses: docker/login-action@v2
90+
- name: Log in to DockerHub
91+
uses: docker/login-action@v3
6492
with:
6593
username: ${{ secrets.DOCKERHUB_USERNAME }}
6694
password: ${{ secrets.DOCKERHUB_PASSWORD }}
6795

68-
- name: Build/Tag/Push Image
69-
uses: docker/build-push-action@v2
96+
- name: Build/Push Image
97+
uses: docker/build-push-action@v5
98+
id: docker_push
7099
with:
71100
context: .
72101
tags: ${{ steps.meta.outputs.tags }}
73102
labels: ${{ steps.meta.outputs.labels }}
74103
file: ./dockerfiles/components/ordhook.dockerfile
104+
cache-from: type=gha
105+
cache-to: type=gha,mode=max
75106
# Only push if (there's a new release on main branch, or if building a non-main branch) and (Only run on non-PR events or only PRs that aren't from forks)
76-
push: ${{ (github.ref != 'refs/heads/master' || steps.semantic.outputs.new_release_version != '') && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) }}
107+
push: ${{ (github.ref != 'refs/heads/main' || steps.semantic.outputs.new_release_version != '') && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) }}
108+
109+
deploy-dev:
110+
runs-on: ubuntu-latest
111+
strategy:
112+
matrix:
113+
k8s-env: [mainnet]
114+
needs: build-publish
115+
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
116+
env:
117+
DEPLOY_ENV: dev
118+
environment:
119+
name: Development-${{ matrix.k8s-env }}
120+
url: https://platform.dev.hiro.so/
121+
steps:
122+
- name: Checkout actions repo
123+
uses: actions/checkout@v4
124+
with:
125+
ref: main
126+
token: ${{ secrets.GH_TOKEN }}
127+
repository: ${{ secrets.DEVOPS_ACTIONS_REPO }}
128+
129+
- name: Deploy Ordhook build to Dev ${{ matrix.k8s-env }}
130+
uses: ./actions/deploy
131+
with:
132+
docker_tag: ${{ needs.build-publish.outputs.docker_image_digest }}
133+
file_pattern: manifests/bitcoin/${{ matrix.k8s-env }}/ordhook/${{ env.DEPLOY_ENV }}/base/kustomization.yaml
134+
gh_token: ${{ secrets.GH_TOKEN }}
135+
136+
auto-approve-dev:
137+
runs-on: ubuntu-latest
138+
if: needs.build-publish.outputs.new_release_published == 'true' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository)
139+
needs: build-publish
140+
steps:
141+
- name: Approve pending deployments
142+
run: |
143+
sleep 5
144+
ENV_IDS=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/hirosystems/ordhook/actions/runs/${{ github.run_id }}/pending_deployments" | jq -r '[.[].environment.id // empty]')
145+
if [[ "${ENV_IDS}" != "[]" ]]; then
146+
curl -s -X POST -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/hirosystems/ordhook/actions/runs/${{ github.run_id }}/pending_deployments" -d "{\"environment_ids\":${ENV_IDS},\"state\":\"approved\",\"comment\":\"auto approve\"}"
147+
fi
148+
149+
deploy-staging:
150+
runs-on: ubuntu-latest
151+
strategy:
152+
matrix:
153+
k8s-env: [mainnet]
154+
needs:
155+
- build-publish
156+
- deploy-dev
157+
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
158+
env:
159+
DEPLOY_ENV: stg
160+
environment:
161+
name: Staging-${{ matrix.k8s-env }}
162+
url: https://platform.stg.hiro.so/
163+
steps:
164+
- name: Checkout actions repo
165+
uses: actions/checkout@v4
166+
with:
167+
ref: main
168+
token: ${{ secrets.GH_TOKEN }}
169+
repository: ${{ secrets.DEVOPS_ACTIONS_REPO }}
170+
171+
- name: Deploy Chainhook build to Stg ${{ matrix.k8s-env }}
172+
uses: ./actions/deploy
173+
with:
174+
docker_tag: ${{ needs.build-publish.outputs.docker_image_digest }}
175+
file_pattern: manifests/bitcoin/${{ matrix.k8s-env }}/ordhook/${{ env.DEPLOY_ENV }}/base/kustomization.yaml
176+
gh_token: ${{ secrets.GH_TOKEN }}
177+
178+
auto-approve-stg:
179+
runs-on: ubuntu-latest
180+
if: needs.build-publish.outputs.new_release_published == 'true' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository)
181+
needs:
182+
- build-publish
183+
- deploy-dev
184+
steps:
185+
- name: Approve pending deployments
186+
run: |
187+
sleep 5
188+
ENV_IDS=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/hirosystems/ordhook/actions/runs/${{ github.run_id }}/pending_deployments" | jq -r '[.[].environment.id // empty]')
189+
if [[ "${ENV_IDS}" != "[]" ]]; then
190+
curl -s -X POST -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/hirosystems/ordhook/actions/runs/${{ github.run_id }}/pending_deployments" -d "{\"environment_ids\":${ENV_IDS},\"state\":\"approved\",\"comment\":\"auto approve\"}"
191+
fi
192+
193+
deploy-prod:
194+
runs-on: ubuntu-latest
195+
strategy:
196+
matrix:
197+
k8s-env: [mainnet,testnet]
198+
needs:
199+
- build-publish
200+
- deploy-staging
201+
if: needs.build-publish.outputs.new_release_published == 'true' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository)
202+
env:
203+
DEPLOY_ENV: prd
204+
environment:
205+
name: Production-${{ matrix.k8s-env }}
206+
url: https://platform.hiro.so/
207+
steps:
208+
- name: Checkout actions repo
209+
uses: actions/checkout@v4
210+
with:
211+
ref: main
212+
token: ${{ secrets.GH_TOKEN }}
213+
repository: ${{ secrets.DEVOPS_ACTIONS_REPO }}
214+
215+
- name: Deploy Ordhook build to Prd ${{ matrix.k8s-env }}
216+
uses: ./actions/deploy
217+
with:
218+
docker_tag: ${{ needs.build-publish.outputs.docker_image_digest }}
219+
file_pattern: manifests/bitcoin/${{ matrix.k8s-env }}/ordhook/${{ env.DEPLOY_ENV }}/base/kustomization.yaml
220+
gh_token: ${{ secrets.GH_TOKEN }}

0 commit comments

Comments
 (0)