-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (51 loc) · 1.84 KB
/
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
name: Generate Celenium API
on:
repository_dispatch:
types: [tag_created]
jobs:
generate_api_job:
name: Generate API & GitHub push
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Delete all files except .github/workflows and LICENSE
run: |
find . -mindepth 1 \
-not -path './.git*' \
-not -path './.github/workflows*' \
-not -name 'LICENSE' \
-exec rm -rf {} +
- name: Generate API client
run: |
docker run --rm \
-v ${{ github.workspace }}:/local openapitools/openapi-generator-cli generate \
-i https://raw.githubusercontent.com/celenium-io/celestia-indexer/${{ github.event.client_payload.tag }}/cmd/api/docs/swagger.json \
-g go \
-p packageName=celenium --skip-validate-spec \
-o /local --git-repo-id celenium-api-go --git-user-id celenium-io
- name: Configure Git
run: |
git config --global user.name "GitHub Actions Bot"
git config --global user.email "[email protected]"
- name: Commit and push changes
run: |
git add .
git commit -m "${{ github.event.client_payload.tag }}"
git push https://x-access-token:${{ secrets.PAT }}@github.com/${{ github.repository }}.git
release:
name: Release
needs: generate_api_job
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Publish GitHub Release
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: ${{ secrets.PAT }}
prerelease: false
automatic_release_tag: ${{ github.event.client_payload.tag }}