-
-
Notifications
You must be signed in to change notification settings - Fork 201
102 lines (92 loc) · 2.91 KB
/
early-release.yml
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
name: Create Early Access Release
on:
workflow_dispatch:
pull_request:
types:
- closed
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Create Release
if: |
(github.event.pull_request.merged == true &&
github.event.pull_request.base.ref == 'main') ||
github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
# SETUP BUILD ENVIRONMENT
- id: prepare-maven-build
name: Prepare Maven build
uses: sualeh/[email protected]
with:
java-version: 8
- id: install-graphviz
name: Install Graphviz
uses: sualeh/[email protected]
# BUILD FOR DISTRIBUTION
- id: build
name: Build and test for distribution
shell: bash
run: |
# Build
mvn \
--no-transfer-progress \
--batch-mode \
-Ddistrib \
clean install
# CREATE GITHUB RELEASE AND ADD ASSETS
- id: tag
name: Move early-access-release tag
shell: bash
if: false
run: |
# Move tag
git tag -d early-access-release
git push --delete origin early-access-release
git tag -a early-access-release -m "SchemaCrawler Early Access Release"
git push --follow-tags
- id: create-release
name: Create GitHub release
uses: softprops/action-gh-release@v2
if: ${{ startsWith(github.ref, 'refs/tags/') != true }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag_name: early-access-release
name: early-access-release
draft: false
prerelease: true
body: |
SchemaCrawler ${{ github.event.release.tag_name }} early access release at last commit ${{ github.sha }}
generate_release_notes: true
files: |
./schemacrawler-distrib/target/schemacrawler-16.25.2-distribution.zip
./schemacrawler-distrib/target/schemacrawler-16.25.2-distribution.zip.SHA-512
./schemacrawler-distrib/target/schemacrawler-16.25.2-bin.zip
./schemacrawler-distrib/target/schemacrawler-16.25.2-bin.zip.SHA-512
# BUILD AND PUBLISH DOCKER IMAGE
- id: setup-qemu
name: Setup QEMU
uses: docker/setup-qemu-action@v3
- id: setup-buildx
name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log into Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and Push Docker Image
uses: docker/build-push-action@v6
with:
file: ./schemacrawler-docker/Dockerfile
context: ./schemacrawler-distrib/target/_expanded-distribution
platforms: |-
linux/amd64
linux/arm64
tags: |-
schemacrawler/schemacrawler:early-access-release
sbom: true
provenance: true
push: true