Skip to content

Commit

Permalink
Add release CI action (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
wichert authored Oct 2, 2023
1 parent 1c75e43 commit c802485
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Publish crate

on:
push:
tags:
- "*"

env:
CARGO_TERM_COLOR: always

jobs:
publish:
name: Publish crate
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Update version number
shell: bash
run: |
version="${GITHUB_REF#*/v}"
sed -i -e "/^version =/s/=.*/= \"${version}\"/" Cargo.toml
cargo check
- name: Commit changes
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Actions"
git commit -m "Update version number" Cargo.toml Cargo.lock
- name: Publish
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_TOKEN }}
run: cargo publish --locked
1 change: 1 addition & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ env:

jobs:
test:
name: Lint and test
runs-on: ubuntu-latest

steps:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*.profraw
*.swp
.DS_Store
/.vscode
Expand Down
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Parser for PostgreSQL dumps in custom format

This crate allows inspecting the contents of a PostgreSQL backup
as made using `pg_dump -Fc` or `pg_dump --format=custom`, and provides
direct access all raw table data. This can be useful if you do not
trust the SQL statements embedded in the dump, or if you want to
process data without loading it into a database.

```rust
use std::fs::File;
use pgarchive::Archive;

let mut file = File::open("tests/test.pgdump").unwrap();
match Archive::parse(&mut file) {
Ok(archive) => println!("This is a backup of {}", archive.database_name),
Err(e) => println!("can not read file: {:?}", e),
};
```

0 comments on commit c802485

Please sign in to comment.