Skip to content

Commit

Permalink
Merge pull request #39 from EricBartusch/main
Browse files Browse the repository at this point in the history
Delete Releases and Renamed Release
  • Loading branch information
DaruniasJoy authored Sep 20, 2024
2 parents 6e80d30 + 03085b5 commit 3c68c34
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/generate-soh-archive.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Get short commit hash
id: vars
run: echo "short_hash=$(git rev-parse --short HEAD)" >> "$GITHUB_ENV"

- name: Generate SoH archive
run: |
cd data
Expand All @@ -28,24 +24,27 @@ jobs:
name: ganondorfsorgan.otr
path: data/mods

# If this repo gets reverted to a previous release or if this workflow ever gets re-ran, creating a new release would break the build
# If you really want to regenerate the release, you'll have to manually delete the release
- name: Check for existing release
- name: List all releases
run: |
releases=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
https://api.github.com/repos/${{ github.repository }}/releases)
if echo "$releases" | grep -q "tag_name\": \"main-$short_hash"; then
echo "Release already exists"
exit 1
fi
echo "$releases" | jq -r '.[].id' > release_ids.txt
- name: Delete all releases
run: |
while IFS= read -r release_id; do
curl -X DELETE -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
https://api.github.com/repos/${{ github.repository }}/releases/$release_id
done < release_ids.txt

- name: Create GitHub Release
id: create_release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: Build-${{ env.short_hash }}
tag_name: latest
draft: false
prerelease: false

Expand All @@ -55,4 +54,5 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: data/mods/ganondorfsorgan.otr
tag_name: Build-${{ env.short_hash }}
tag_name: latest
name: Ship of Harkinian Bundle

0 comments on commit 3c68c34

Please sign in to comment.