Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
218 commits
Select commit Hold shift + click to select a range
454f93a
Document --migrations--table flag (#186)
amacneil Dec 13, 2020
2bac2c7
Write log lines to DB.Log output (#195)
bouk Feb 18, 2021
0c758a8
Go v1.16 (#196)
amacneil Feb 22, 2021
53c9c19
master -> main (#201)
amacneil Mar 4, 2021
ece2c3c
Improve error message when database URL is missing (#202)
silbinarywolf Mar 9, 2021
0802242
mysql: Fix escaping of '+' character in passwords (#200)
matt-snider Mar 9, 2021
7b92033
Support non-UTC timezones (#208)
Flamefork Apr 2, 2021
b020782
v1.12.0 (#210)
amacneil Apr 7, 2021
abd02b7
Update features for golang-migrate (#205)
breml Apr 7, 2021
cdbbdd6
Add Apple silicon (darwin/arm64) build (#211)
amacneil Apr 7, 2021
7c6f9ed
Add vscode config (#222)
amacneil Jul 22, 2021
4a3698c
Publish Docker image (#220)
amacneil Jul 22, 2021
511336d
v1.12.1 (#223)
amacneil Jul 22, 2021
26d5f9f
Strip leading 'v' for docker image tags (#224)
amacneil Jul 22, 2021
6243c2b
Update readme with new docker image (#225)
amacneil Jul 22, 2021
fb17e8e
refactor: move from io/ioutil to io and os package (#236)
Juneezee Aug 27, 2021
81fe01b
Postgres defaults to unix socket (#230)
wraithm Dec 18, 2021
06d8bb7
Remove CodeQL workflow
amacneil Dec 18, 2021
f69f1de
Build using native OS workers (#231)
amacneil Dec 20, 2021
955c9ac
Update to MySQL 8.0 image for testing (#250)
amacneil Dec 20, 2021
c99d611
Upgrade golangci-lint to v1.43.0 (#251)
amacneil Dec 20, 2021
52cd75f
Publish multiarch docker images (#241)
Aposhian Dec 29, 2021
5b60f68
Add Dependabot for GitHub Actions
amacneil Jan 3, 2022
f0c8c17
Upgrade to Go 1.17. (#259)
sundbp Jan 18, 2022
3ce19f4
Update dependencies (#260)
amacneil Jan 18, 2022
5cd9e25
v1.13.0 (#261)
amacneil Jan 18, 2022
1c2e5e5
Make status command read only (#242)
Jell Jan 30, 2022
f245943
Add scoop install instructions for windows (#263)
rminderhoud Jan 30, 2022
3fd6d5c
Fix whitespace issues in SQLite absolute paths in DATABASE_URL (#266)
Enrico204 Jan 30, 2022
09b8d69
sqlite: Add test for two slashes in URL (#269)
amacneil Jan 30, 2022
5159bae
Append .exe to Windows builds (#270)
amacneil Jan 30, 2022
519f186
v1.14.0 (#271)
amacneil Feb 4, 2022
512b6b2
Bump actions/checkout from 2 to 3 (#277)
dependabot[bot] Mar 3, 2022
ceae654
minor typo in README (#278)
andyli Mar 10, 2022
de387c6
Move sqlite driver import behind build constraint (#287)
cloneable Mar 25, 2022
e6dd591
Go v1.18 (#288)
amacneil Mar 25, 2022
c0555a1
v1.15.0
amacneil Mar 25, 2022
1613f72
Bump actions/setup-go from 2 to 3 (#290)
dependabot[bot] Apr 11, 2022
28d5323
Bump docker/build-push-action from 2 to 3 (#298)
dependabot[bot] May 6, 2022
5de6eea
Bump docker/setup-qemu-action from 1 to 2 (#297)
dependabot[bot] May 6, 2022
f8c2e9b
Bump docker/metadata-action from 3 to 4 (#296)
dependabot[bot] May 6, 2022
af695b0
Bump docker/login-action from 1 to 2 (#295)
dependabot[bot] May 6, 2022
c9a0fe8
Add arm32 cross compilation on github action (#293)
edaubert May 6, 2022
d671075
Bump docker/setup-buildx-action from 1 to 2 (#294)
dependabot[bot] May 6, 2022
c047626
chore: export errors, fix #292 (#302)
gnuletik May 31, 2022
16b8492
Upload build artifacts from CI (#299)
amacneil Jul 12, 2022
e53843b
postgres: Fix host param parsing (#318)
niclaslovdahl Sep 20, 2022
3f6169a
Trim AUTO_INCREMENT values from MySQL schema dumps (#319)
shames0 Sep 23, 2022
6dc8ada
docker: Support mariadb caching_sha2_password (#308)
shames0 Sep 25, 2022
8a3e711
Enable Dependabot for Go modules
amacneil Sep 25, 2022
b1d3fa6
Bump github.com/stretchr/testify from 1.7.0 to 1.8.0 (#320)
dependabot[bot] Sep 26, 2022
cd01df4
Bump github.com/urfave/cli/v2 from 2.4.0 to 2.20.2 (#327)
dependabot[bot] Oct 22, 2022
7eb1b38
Bump github.com/lib/pq from 1.10.4 to 1.10.7 (#322)
dependabot[bot] Oct 22, 2022
f1f201c
Bump github.com/mattn/go-sqlite3 from 1.14.12 to 1.14.15 (#321)
dependabot[bot] Oct 22, 2022
1e2fa7b
golangci-lint v1.50.1 (#330)
amacneil Oct 22, 2022
ebf26ce
Go 1.19 (#329)
amacneil Oct 22, 2022
649e03f
v1.16.0 (#331)
amacneil Oct 22, 2022
2619a29
Dependabot is too noisy for this repo
amacneil Nov 7, 2022
9af7e75
Bump mislav/bump-homebrew-formula-action from 1 to 2 (#342)
dependabot[bot] Nov 26, 2022
f413bb4
Fixes typo in error message: up bock -> up block (#341)
wkalt Nov 26, 2022
00b2f58
Update dependencies (#343)
amacneil Nov 26, 2022
3126deb
vscode: format with goimports (#344)
amacneil Nov 26, 2022
755ce1d
Update README.md
amacneil Dec 19, 2022
cd19cb4
Add issue template
amacneil Dec 19, 2022
d1f3017
Update dependencies (#381)
amacneil Jan 31, 2023
f3bc9f5
v1.16.1
amacneil Jan 31, 2023
3a9a4f1
Fix create db and upgrade clickhouse-server to v22.8 (#380)
farbodsalimi Jan 31, 2023
74bf9fc
v1.16.2
amacneil Jan 31, 2023
646a1aa
Fix go build vcs errors (#385)
amacneil Feb 18, 2023
855fb63
Bump docker/build-push-action from 3 to 4 (#382)
dependabot[bot] Feb 19, 2023
4ff6a02
Always wait when creating driver (#386)
amacneil Feb 20, 2023
447ea69
Clickhouse: Fix CheckMigrationTableExists (#387)
docapotamus Feb 20, 2023
afe38bd
Support embedded filesystem migrations (#388)
amacneil Feb 21, 2023
477b443
SQLite: Do not dump system tables (#383)
docapotamus Feb 21, 2023
a352145
Adds flyway to the comparison table (#306)
mwhitm Feb 21, 2023
45f6e9f
Document library use and embedding (#389)
amacneil Feb 21, 2023
9f1f346
MySQL: Fix unix socket support in dump action (#267)
Enrico204 Feb 21, 2023
3fe17e0
Shorter version column, use default charset for mysql (#391)
amacneil Feb 26, 2023
3a81bdf
Fix clickhouse dump error (#394)
amacneil Feb 26, 2023
6d5099c
Go v1.20 (#396)
amacneil Feb 26, 2023
32e9d70
Upgrade clickhouse-go to v2 (#395)
amacneil Feb 26, 2023
a02315f
Stricter migration parsing (#397)
amacneil Feb 27, 2023
04cfc80
Update import paths for v2 (#398)
amacneil Feb 27, 2023
7b085d2
ClickHouse: Remove inaccurate comment (#399)
amacneil Feb 27, 2023
57a17ac
Add npm package (#400)
amacneil Feb 27, 2023
43635b2
npm: Fix package path on windows (#401)
amacneil Feb 27, 2023
c0d15db
v2.0.0 (#402)
amacneil Feb 27, 2023
0b6e2ee
Fix absolute migration directory support (#406)
amacneil Feb 28, 2023
ee50711
Fix subsequent rollbacks (#405)
sunaurus Feb 28, 2023
4e14aa8
More thorough rollback tests (#407)
amacneil Feb 28, 2023
80d8791
v2.0.1 (#408)
amacneil Feb 28, 2023
7e288f5
Remove arm32 docker image (#410)
amacneil Mar 1, 2023
cbe3ed0
Add 386 build (#409)
amacneil Mar 1, 2023
b16f33a
Add Sqitch to comparison (#414)
ttfkam Mar 12, 2023
e9cc0e3
Generate typescript packages into dist dir (#415)
amacneil Mar 13, 2023
c1000a4
Add eslint (#416)
amacneil Mar 13, 2023
8944097
Move driver imports to main.go (#417)
amacneil Mar 13, 2023
207b42e
Convert dbmate npm package to esm+typescript (#418)
amacneil Mar 13, 2023
7429d92
v2.1.0 (#421)
amacneil Mar 18, 2023
7279a8d
Bump actions/setup-go from 3 to 4 (#422)
dependabot[bot] Mar 21, 2023
210f602
Publish CommonJS module (#425)
amacneil Mar 21, 2023
02a1790
v2.2.0 (#426)
amacneil Mar 21, 2023
5d1b521
Support multiple --migrations-dir directories (#428)
dossy Apr 21, 2023
4e831c8
Bump yaml from 2.2.1 to 2.2.2 in /typescript (#437)
dependabot[bot] May 2, 2023
b6195bd
Update README.md (#442)
morya May 12, 2023
f4610da
v2.3.0 (#443)
amacneil May 12, 2023
cfd8082
Update RELEASING.md
amacneil May 12, 2023
a336dbb
ClickHouse: Support migrations on cluster (#432)
FatherCandle May 15, 2023
bcedf0d
Read GitHub Actions go version from go.mod (#448)
amacneil May 21, 2023
9181d85
Postgres: Add support for schemas containing special characters (#446)
alfredringstad May 25, 2023
9ae6172
v2.4.0 (#449)
amacneil May 31, 2023
0535bd3
Update dependencies (#456)
amacneil Jun 23, 2023
eac105f
v2.5.0 (#457)
amacneil Jun 23, 2023
f1eefae
Bump word-wrap from 1.2.3 to 1.2.4 in /typescript (#461)
dependabot[bot] Jul 25, 2023
7f82dfe
Fix docker-compose warning (#465)
philip-hartmann Aug 16, 2023
f3c1ade
Update README.md about percent encoding DATABASE_URL (#466)
kmchmk Aug 26, 2023
6245b8c
v2.6.0 (#467)
amacneil Aug 26, 2023
4d8b87e
Bump docker/build-push-action from 4 to 5 (#476)
dependabot[bot] Sep 21, 2023
6f13cee
Bump docker/metadata-action from 4 to 5 (#477)
dependabot[bot] Sep 21, 2023
48d2894
Bump docker/login-action from 2 to 3 (#478)
dependabot[bot] Sep 21, 2023
85f1979
Bump docker/setup-buildx-action from 2 to 3 (#479)
dependabot[bot] Sep 21, 2023
2fd633f
Bump actions/checkout from 3 to 4 (#473)
dependabot[bot] Sep 21, 2023
a403757
Bump mislav/bump-homebrew-formula-action from 2 to 3 (#482)
dependabot[bot] Sep 29, 2023
20b3d84
Bump docker/setup-qemu-action from 2 to 3 (#483)
dependabot[bot] Sep 29, 2023
26dd5ea
Add ARMv6 support (#486)
amacneil Oct 8, 2023
8bbf517
v2.7.0 (#493)
amacneil Oct 27, 2023
1658a46
Add --strict flag (#441)
philip-hartmann Nov 14, 2023
5386efb
pkg/driver/mysql: use single quotes to satisfy the ANSI_QUOTE mode (#…
toru Nov 15, 2023
1b5ca4f
Bump actions/setup-node from 3 to 4 (#494)
dependabot[bot] Nov 15, 2023
d74b06f
Add line/column/position details to Postgres migration/rollback query…
dossy Nov 16, 2023
e87887f
fix/correctly parse crlf line endings (#496)
dossy Nov 16, 2023
9e653e7
v2.8.0 (#497)
amacneil Nov 16, 2023
7320764
fix: typo (#498)
testwill Nov 19, 2023
c641805
support --env-file CLI option (#274) (#491)
hamza512b Nov 26, 2023
e4938eb
Make appending to FLAGS possible when invoking make. (#499)
dossy Nov 26, 2023
5593378
Add load command to import schema (#469)
s1owjke Dec 11, 2023
1b46e3e
Bump actions/setup-go from 4 to 5 (#504)
dependabot[bot] Dec 12, 2023
ed0ab13
v2.9.0 (#505)
amacneil Dec 12, 2023
b9f9b16
Bump actions/upload-artifact and actions/download-artifact from 3 to …
dependabot[bot] Dec 18, 2023
3d2aa8f
Enable dependabot for docker images (#509)
amacneil Dec 21, 2023
684b1ea
Bump golang from 1.21.4 to 1.21.5 (#511)
dependabot[bot] Dec 21, 2023
62b04ea
v2.10.0 (#510)
amacneil Dec 21, 2023
8dfb7fd
Readme: Remove Docker Hub
amacneil Dec 27, 2023
c415157
Add Redshift support (#488)
aterekhov-plr Jan 9, 2024
ffc811e
Bump golang from 1.21.5 to 1.21.6 (#512)
dependabot[bot] Jan 17, 2024
cbdb6e5
v2.11.0 (#513)
amacneil Jan 17, 2024
ae31282
Bump alpine from 3.19.0 to 3.19.1 (#517)
dependabot[bot] Jan 31, 2024
ba5649c
Auto approve dependabot PRs (#518)
amacneil Jan 31, 2024
6f0ff57
Bump golang from 1.21.6 to 1.22.0 (#519)
dependabot[bot] Feb 13, 2024
d0f5fb1
v2.12.0 (#520)
amacneil Feb 13, 2024
9e0564d
Bump ip from 2.0.0 to 2.0.1 in /typescript (#521)
dependabot[bot] Feb 21, 2024
a88c170
Bump softprops/action-gh-release from 1 to 2 (#525)
dependabot[bot] Mar 11, 2024
b97f9c8
Bump golang from 1.22.0 to 1.22.1 (#524)
dependabot[bot] Mar 11, 2024
97d9af2
v2.13.0 (#526)
amacneil Mar 11, 2024
b9e6fee
Add BigQuery support (#523)
Mar 26, 2024
f485fb4
Bump google.golang.org/protobuf from 1.31.0 to 1.33.0 (#533)
dependabot[bot] Mar 26, 2024
ea89778
v2.14.0 (#534)
amacneil Mar 28, 2024
716b623
fix: embedded fs on windows (#537)
Dissociable Apr 11, 2024
fcc7f48
Enable timeout flag in `make fix`. (#540)
rilma Apr 18, 2024
514a327
Bump golang from 1.22.1 to 1.22.2 (#535)
dependabot[bot] Apr 19, 2024
b3a08e2
Bump golang.org/x/net from 0.22.0 to 0.23.0 (#541)
dependabot[bot] Apr 19, 2024
8741631
v2.15.0 (#542)
amacneil Apr 20, 2024
92fbde5
CI: Run tests on all platforms (#543)
amacneil Apr 21, 2024
88486cb
Clean up test helper functions (#544)
amacneil Apr 21, 2024
05a85b4
Bump golang from 1.22.2 to 1.22.3 (#546)
dependabot[bot] May 19, 2024
c6caf08
v2.16.0 (#548)
amacneil May 19, 2024
0e1b2d0
Bump alpine from 3.19.1 to 3.20.0 (#549)
dependabot[bot] May 29, 2024
9107c09
prints the migrate/rollback execution time (#550)
thinhbuzz Jun 4, 2024
ad87167
Bump golang from 1.22.3 to 1.22.4 (#552)
dependabot[bot] Jun 10, 2024
4971ac4
v2.17.0 (#553)
amacneil Jun 10, 2024
9b95d4c
Bump braces from 3.0.2 to 3.0.3 in /typescript (#554)
dependabot[bot] Jun 11, 2024
6c1165f
Update README.md
amacneil Jun 18, 2024
3c1e5a1
Bump alpine from 3.20.0 to 3.20.1 (#557)
dependabot[bot] Jun 24, 2024
b71a931
Bump docker/build-push-action from 5 to 6 (#556)
dependabot[bot] Jun 24, 2024
95b49f1
v2.18.0 (#558)
amacneil Jul 1, 2024
95461d6
Spanner Postgres interface support (#555)
grahamhoyes Jul 9, 2024
6addaa1
Update README.md
amacneil Jul 10, 2024
b4859a3
Bump google.golang.org/grpc from 1.64.0 to 1.64.1 (#560)
dependabot[bot] Jul 10, 2024
dbeb393
Bump golang from 1.22.4 to 1.22.5 (#559)
dependabot[bot] Jul 10, 2024
1569329
Add Dev Container (#562)
amacneil Jul 10, 2024
2edaf0e
v2.19.0 (#563)
amacneil Jul 10, 2024
8db7622
Bump alpine from 3.20.1 to 3.20.2 (#567)
dependabot[bot] Aug 12, 2024
8079766
Update docker compose syntax to keep GitHub Actions happy (#569)
amacneil Aug 19, 2024
455b50f
Bump golang from 1.22.5 to 1.23.0 (#570)
dependabot[bot] Aug 20, 2024
cca1e18
Bump CI to Node v20 (#571)
amacneil Aug 20, 2024
9ac7ea7
v2.20.0 (#572)
amacneil Aug 20, 2024
f012978
Bump alpine from 3.20.2 to 3.20.3 (#576)
dependabot[bot] Sep 16, 2024
ae38fb4
Bump golang from 1.23.0 to 1.23.1 (#575)
dependabot[bot] Sep 16, 2024
f9c7be2
v2.21.0 (#578)
amacneil Sep 16, 2024
5b1bbeb
Enable FTS5 in SQLite migrations (#582)
Oct 14, 2024
a2e823c
Update README.md
amacneil Nov 1, 2024
7c3541f
Bump golang from 1.23.1 to 1.23.2 (#583)
dependabot[bot] Nov 1, 2024
c092d1a
Remove dollar sign from README.md commands (#584)
o-az Nov 1, 2024
2c64d41
Fix typo in Makefile
amacneil Nov 2, 2024
c6e23f9
Upgrade to eslint v9 (#588)
amacneil Nov 2, 2024
e6feec8
v2.22.0 (#590)
amacneil Nov 9, 2024
674dba8
Bump golang from 1.23.2 to 1.23.3 (#591)
dependabot[bot] Nov 11, 2024
9594248
v2.23.0 (#592)
amacneil Nov 11, 2024
34ae78d
Bump alpine from 3.20.3 to 3.21.0 (#599)
dependabot[bot] Dec 9, 2024
194a18a
Bump golang from 1.23.3 to 1.23.4 (#600)
dependabot[bot] Dec 9, 2024
1acb12f
v2.24.0 (#601)
amacneil Dec 9, 2024
0abc77b
Upgrade golang.org/x/crypto to v0.31.0 (#603)
TMathers-rula Dec 19, 2024
f89e97f
v2.24.1 (#604)
amacneil Dec 19, 2024
31ac21e
Bump golang.org/x/net to v0.33.0 (#605)
amacneil Dec 19, 2024
da0086e
v2.24.2 (#606)
amacneil Dec 19, 2024
f16c5ee
Bump alpine from 3.21.0 to 3.21.2 (#611)
dependabot[bot] Jan 14, 2025
211f5f4
Bump golang from 1.23.4 to 1.23.5 (#612)
dependabot[bot] Jan 22, 2025
a5dd64b
v2.25.0 (#613)
amacneil Jan 22, 2025
48032cb
Remove binary_parameters from pg_dump database url (#614)
ultrotter Jan 22, 2025
19d4405
Bump alpine from 3.21.2 to 3.21.3 (#618)
dependabot[bot] Feb 18, 2025
c9adc55
Bump golang from 1.23.5 to 1.24.0 (#617)
dependabot[bot] Feb 19, 2025
abd4165
v2.26.0 (#619)
amacneil Feb 19, 2025
2276c7d
rebase(dbmate): rebase on v2.26.0
flipsed Apr 7, 2025
a661999
Merge branch 'master' into upgrade-to-v2.26.0
flipsed Apr 7, 2025
df398af
fix(maincgo): use assetnote path
flipsed Apr 7, 2025
71d8568
Merge branch 'upgrade-to-v2.26.0' of github.com:assetnote/dbmate into…
flipsed Apr 7, 2025
ce58bdc
fix(main): assignment
flipsed Apr 7, 2025
f4ec083
chore(import): refactor
flipsed Apr 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"dockerComposeFile": "../docker-compose.yml",
"service": "dev",
"workspaceFolder": "/src",
"overrideCommand": true
}
1 change: 0 additions & 1 deletion .dockerignore

This file was deleted.

18 changes: 18 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: "🐞 Bug report"
about: Report broken functionality or incorrect documentation
labels: "bug"
---

**Description**


- Version:
- Database:
- Operating System:

**Steps To Reproduce**
<!--- Include the minimum possible code or example data to reproduce the problem. -->


**Expected Behavior**
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
blank_issues_enabled: true
contact_links:
- name: "🙋‍♀️ Question"
url: https://github.com/amacneil/dbmate/discussions
about: Search discussions or ask our community for help
- name: "🚀 Feature request"
url: https://github.com/amacneil/dbmate/discussions
about: Search existing feature requests or share a new idea
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2
updates:
- package-ecosystem: docker
directory: /
schedule:
interval: weekly

- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
63 changes: 0 additions & 63 deletions .github/workflows/build.yml

This file was deleted.

232 changes: 232 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,232 @@
name: CI

on:
push:
branches: [main]
tags: ["*"]
pull_request:

jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: linux
image: ubuntu-latest
arch: 386
setup: sudo apt-get update && sudo apt-get install -qq gcc-i686-linux-gnu
env:
CC: i686-linux-gnu-gcc
CXX: i686-linux-gnu-g++
- os: linux
image: ubuntu-latest
arch: amd64
env: {}
- os: linux
image: ubuntu-latest
arch: arm
setup: sudo apt-get update && sudo apt-get install -qq gcc-arm-linux-gnueabi
env:
CC: arm-linux-gnueabi-gcc
CXX: arm-linux-gnueabi-g++
GOARM: 6
- os: linux
image: ubuntu-latest
arch: arm64
setup: sudo apt-get update && sudo apt-get install -qq gcc-aarch64-linux-gnu
env:
CC: aarch64-linux-gnu-gcc
CXX: aarch64-linux-gnu-g++
- os: macos
image: macos-latest
arch: amd64
env: {}
- os: macos
image: macos-latest
arch: arm64
env: {}
- os: windows
image: windows-latest
arch: amd64
setup: choco install sqlite
env: {}

name: Build (${{ matrix.os }}/${{ matrix.arch }})
runs-on: ${{ matrix.image }}
env: ${{ matrix.env }}

steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v5
with:
go-version-file: go.mod

- name: Setup environment
run: ${{ matrix.setup }}

- run: go mod download

- run: make build ls
env:
GOARCH: ${{ matrix.arch }}
OUTPUT: dbmate-${{ matrix.os }}-${{ matrix.arch }}

- run: make test
if: ${{ matrix.arch == 'amd64' }}
env:
GOARCH: ${{ matrix.arch }}

- run: dist/dbmate-${{ matrix.os }}-${{ matrix.arch }} --help
if: ${{ matrix.arch == 'amd64' }}

- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: dbmate-${{ matrix.os }}-${{ matrix.arch }}
path: dist/dbmate-*

- name: Publish binaries
uses: softprops/action-gh-release@v2
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
with:
files: dist/dbmate-*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

docker:
name: Docker Test (linux/amd64)
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Configure QEMU
uses: docker/setup-qemu-action@v3

- name: Configure Buildx
uses: docker/setup-buildx-action@v3

- name: Check Docker environment
run: |
set -x
docker version
docker buildx version
docker compose version

- name: Build Docker image
run: |
set -x
docker compose build
docker compose run --rm --no-deps dbmate --version

- name: Run make build
run: docker compose run --rm --no-deps dev make build ls

- name: Run make lint
run: docker compose run --rm --no-deps dev make lint

- name: Start test dependencies
run: |
set -x
docker compose pull --ignore-buildable --quiet
docker compose up --detach
docker compose run --rm dev make wait

- name: Run make test
run: docker compose run --rm dev make test

- name: Login to Docker Hub
uses: docker/login-action@v3
if: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') }}
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
if: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') }}
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Generate Docker image tags
id: meta
uses: docker/metadata-action@v5
if: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') }}
with:
images: |
${{ github.repository }}
ghcr.io/${{ github.repository }}
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}

- name: Publish Docker image
uses: docker/build-push-action@v6
if: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') }}
with:
context: .
target: release
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

npm:
name: NPM
runs-on: ubuntu-latest
needs: build

steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org
cache: npm
cache-dependency-path: typescript/package-lock.json

- uses: actions/download-artifact@v4
with:
path: dist

- run: find dist

- run: npm ci
working-directory: typescript

- run: npm run lint:ci
working-directory: typescript

- run: npm run generate
working-directory: typescript

- run: npm run publish
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
working-directory: typescript
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}

dependabot:
name: Dependabot
runs-on: ubuntu-latest
permissions:
pull-requests: write
if: github.event.pull_request.user.login == 'dependabot[bot]'
steps:
- name: Automatically approve dependabot PRs
uses: octokit/request-action@v2.x
with:
route: POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews
owner: ${{ github.event.repository.owner.login }}
repo: ${{ github.event.repository.name }}
pull_number: ${{ github.event.pull_request.number }}
event: APPROVE
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading
Loading