Skip to content
This repository was archived by the owner on Sep 26, 2025. It is now read-only.

Commit d70b564

Browse files
authored
chore: add releases.json file (#163)
1 parent fa603fe commit d70b564

1 file changed

Lines changed: 37 additions & 3 deletions

File tree

.github/workflows/release.yaml

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
goarch: ["386", amd64, arm64]
2222
exclude:
2323
- goarch: "386"
24-
goos: darwin
24+
goos: darwin
2525
- goarch: arm64
2626
goos: windows
2727
- goarch: arm64
@@ -33,7 +33,7 @@ jobs:
3333
run: |
3434
echo VERSION=$(basename ${GITHUB_REF}) >> ${GITHUB_ENV}
3535
echo $(basename ${GITHUB_REF})
36-
36+
3737
- name: Generate Binary
3838
uses: wangyoucao577/go-release-action@v1.22
3939
with:
@@ -42,4 +42,38 @@ jobs:
4242
goos: ${{ matrix.goos }}
4343
goarch: ${{ matrix.goarch }}
4444
# binary_name: cli
45-
ldflags: -X "github.com/${{ github.repository }}/cmd.Version=${{ env.VERSION }}" -X "github.com/${{ github.repository }}/nhost.REPOSITORY=${{ github.repository }}"
45+
ldflags: -X "github.com/${{ github.repository }}/cmd.Version=${{ env.VERSION }}" -X "github.com/${{ github.repository }}/nhost.REPOSITORY=${{ github.repository }}"
46+
47+
- uses: actions/checkout@v3
48+
with:
49+
ref: gh-pages
50+
- name: Generate releases.json
51+
shell: bash
52+
env:
53+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
54+
run: |
55+
gh api repos/nhost/cli/releases > releases.json
56+
- name: Check if there are changes
57+
id: changes
58+
shell: bash
59+
run: |
60+
if [[ -z "$(git status --porcelain . )" ]]; then
61+
echo "::set-output name=changed::0"
62+
else
63+
echo "::set-output name=changed::1"
64+
fi
65+
- name: Committing releases.json
66+
shell: bash
67+
if: steps.changes.outputs.changed == 1
68+
run: |
69+
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
70+
git config --local user.name "github-actions[bot]"
71+
git add .
72+
git commit -m "" --allow-empty-message
73+
- name: Push changes
74+
uses: ad-m/github-push-action@master
75+
if: steps.changes.outputs.changed == 1
76+
with:
77+
github_token: ${{ secrets.GITHUB_TOKEN }}
78+
branch: gh-pages
79+
force: true

0 commit comments

Comments
 (0)