-
-
Notifications
You must be signed in to change notification settings - Fork 0
149 lines (127 loc) · 5.06 KB
/
release.yml
File metadata and controls
149 lines (127 loc) · 5.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
name: Release
on:
workflow_dispatch:
permissions:
contents: write
packages: write
env:
RUST_LOG: info
RUST_BACKTRACE: 1
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: false
jobs:
extract_version:
name: Extract Version
runs-on: ubuntu-latest
outputs:
version: ${{ steps.set_version.outputs.version }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up git-cliff
uses: kenji-miyake/setup-git-cliff@v1
- name: Set version name
id: set_version
run: echo "version=$(git cliff --bumped-version)" >> "$GITHUB_OUTPUT"
test:
name: Test Release Build
runs-on: ubuntu-22.04
steps:
- name: Start PostgreSQL with logical replication
run: |
docker run -d \
--name postgres \
-e POSTGRES_USER=postgres \
-e POSTGRES_PASSWORD=postgres \
-e POSTGRES_DB=testdb \
-p 5432:5432 \
--health-cmd "pg_isready -U postgres -d testdb" \
--health-interval 2s \
--health-timeout 5s \
--health-retries 5 \
postgres:17 \
postgres \
-c wal_level=logical \
-c max_wal_senders=10 \
-c max_replication_slots=10
# Wait for postgres to be ready
until docker exec postgres pg_isready -U postgres -d testdb; do
echo "Waiting for postgres..."
sleep 1
done
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Install toolchain
uses: moonrepo/setup-rust@v1
with:
cache-base: main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run tests in release mode
run: cargo test --release --all-features
create_release:
name: Create GitHub Release Draft
runs-on: ubuntu-latest
needs: [extract_version, test]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Create Changelog
uses: orhun/git-cliff-action@v4
id: changelog
with:
config: cliff.toml
args: --bump --unreleased
env:
GITHUB_REPO: ${{ github.repository }}
- name: Ensure tag matches
if: steps.changelog.outputs.version != needs.extract_version.outputs.version
run: |
echo "Tag does not match: ${{ steps.changelog.outputs.version }} vs ${{ needs.extract_version.outputs.version }}"
exit 1
- name: Create Release
uses: softprops/action-gh-release@v2
id: create-release
with:
body: |
${{ steps.changelog.outputs.content }}
## Docker Images
Each sink has its own image. Pull the one you need:
| Sink | Image |
|------|-------|
| Elasticsearch | `ghcr.io/${{ github.repository }}:elasticsearch-${{ needs.extract_version.outputs.version }}` |
| GCP Pub/Sub | `ghcr.io/${{ github.repository }}:gcp-pubsub-${{ needs.extract_version.outputs.version }}` |
| Kafka | `ghcr.io/${{ github.repository }}:kafka-${{ needs.extract_version.outputs.version }}` |
| Kinesis | `ghcr.io/${{ github.repository }}:kinesis-${{ needs.extract_version.outputs.version }}` |
| Meilisearch | `ghcr.io/${{ github.repository }}:meilisearch-${{ needs.extract_version.outputs.version }}` |
| NATS | `ghcr.io/${{ github.repository }}:nats-${{ needs.extract_version.outputs.version }}` |
| RabbitMQ | `ghcr.io/${{ github.repository }}:rabbitmq-${{ needs.extract_version.outputs.version }}` |
| Redis Streams | `ghcr.io/${{ github.repository }}:redis-streams-${{ needs.extract_version.outputs.version }}` |
| Redis Strings | `ghcr.io/${{ github.repository }}:redis-strings-${{ needs.extract_version.outputs.version }}` |
| SNS | `ghcr.io/${{ github.repository }}:sns-${{ needs.extract_version.outputs.version }}` |
| SQS | `ghcr.io/${{ github.repository }}:sqs-${{ needs.extract_version.outputs.version }}` |
| Webhook | `ghcr.io/${{ github.repository }}:webhook-${{ needs.extract_version.outputs.version }}` |
```bash
docker pull ghcr.io/${{ github.repository }}:<sink>-${{ needs.extract_version.outputs.version }}
```
tag_name: ${{ steps.changelog.outputs.version }}
draft: true
- name: Output Link to Workflow Summary
run: |
{
echo "# 📝 Release Draft Created!"
echo ""
echo "## Next Steps"
echo "1. Review the release draft: [Link](${{ steps.create-release.outputs.url }})"
echo "2. Edit the release notes if needed"
echo "3. Click **Publish Release** to:"
echo " - Make the release public"
echo " - Trigger Docker image build and push to ghcr.io"
echo ""
} >> "$GITHUB_STEP_SUMMARY"