Skip to content

Commit 629ebf1

Browse files
committed
fix: fix ci"
1 parent b69c97f commit 629ebf1

1 file changed

Lines changed: 39 additions & 9 deletions

File tree

.github/workflows/release.yml

Lines changed: 39 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ jobs:
1616
- name: Checkout
1717
uses: actions/checkout@v4
1818
with:
19-
# Make sure the release step uses its own credentials:
20-
# https://github.com/cycjimmy/semantic-release-action#private-packages
2119
persist-credentials: false
2220
fetch-depth: 0
2321

@@ -46,13 +44,45 @@ jobs:
4644
fingerprint: ${{ env.GPG_FINGERPRINT }}
4745

4846
- name: Release
49-
id: semantic_release
47+
id: semantic_release
5048
env:
5149
GITHUB_TOKEN: ${{ secrets.REPOSITORY_PUSH_ACCESS }}
52-
run: npm exec semantic-release
53-
54-
- name: Call Update Bundle Workflow
55-
if: github.ref == 'refs/heads/main' # Check if the branch is main
56-
uses: ./.github/workflows/update-bundle.yml # Path to the update-bundle workflow
50+
run: |
51+
output=$(npm exec semantic-release)
52+
echo "$output"
53+
version=$(echo "$output" | grep -oP '(?<=Published version: )\d+\.\d+\.\d+')
54+
echo "::set-output name=version::$version"
55+
56+
- name: Update Bundle
57+
if: startsWith(github.ref, 'refs/heads/main') # Safer condition
58+
run: |
59+
version=${{ steps.semantic_release.outputs.version }}
60+
patches_asset_url="https://github.com/indrastorms/Dropped-Patches/releases/latest/download/patches-${version}.rvp"
61+
signature_download_url="https://github.com/indrastorms/Dropped-Patches/releases/latest/download/patches-${version}.rvp.asc"
62+
63+
info_dict=$(cat <<EOF
64+
{
65+
"created_at": "$(date -u +"%Y-%m-%dT%H:%M:%SZ")",
66+
"description": "Release version ${version}",
67+
"download_url": "${patches_asset_url}",
68+
"signature_download_url": "${signature_download_url}",
69+
"version": "${version}"
70+
}
71+
EOF
72+
)
73+
74+
echo "bundle_file=dropped-patches-bundle.json" >> $GITHUB_ENV
75+
echo "$info_dict" > "${{ env.bundle_file }}"
76+
echo "Latest release information saved to ${{ env.bundle_file }}"
77+
78+
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
79+
git config --local user.name "github-actions[bot]"
80+
git add ${{ env.bundle_file }}
81+
git commit -m "update ${{ env.bundle_file }} [skip ci]"
82+
83+
- name: Push changes
84+
if: startsWith(github.ref, 'refs/heads/main') # Ensure this matches the main branch condition
85+
uses: ad-m/github-push-action@master
5786
with:
58-
version: ${{ steps.semantic_release.outputs.version }} # Pass the version output
87+
github_token: ${{ secrets.GIT_TOKEN }}
88+
branch: main

0 commit comments

Comments
 (0)