Fix release action

This commit is contained in:
Jikoo
2021-03-22 09:42:11 -04:00
parent 18c7916d79
commit e09e7c59c7
3 changed files with 14 additions and 13 deletions

View File

@@ -2,8 +2,6 @@ name: OpenInv CI
on:
push:
create:
types: [tag]
pull_request_target:
jobs:
@@ -51,18 +49,20 @@ jobs:
release:
name: Create Github Release
needs: [ build ]
if: github.event_name == 'create' && github.event.ref_type == 'tag'
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set Release Variables
run: bash ./scripts/set_release_env.sh
- name: Download Artifacts
uses: actions/download-artifact@v2
- name: Set Release Variables
run: . scripts/set_release_env.sh
- name: Create Release
id: create-release
uses: softprops/action-gh-release@v0.1.5
@@ -73,4 +73,4 @@ jobs:
body: ${{ env.GENERATED_CHANGELOG }}
draft: true
prerelease: false
files: ./OpenInv.jar
files: ./dist/OpenInv.jar

View File

@@ -10,6 +10,8 @@ jobs:
steps:
- name: Checkout Code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set CurseForge Variables
run: . scripts/set_curseforge_env.sh

View File

@@ -21,9 +21,6 @@
# Query GitHub for the username of the given email address.
# Falls through to the given author name.
function lookup_email_username() {
# Ensure fallthrough is set
${2:?Must provide email and username as parameters, i.e. 'lookup_email_username admin@example.com Admin'}
lookup=$(curl -G --data-urlencode "q=$1 in:email" https://api.github.com/search/users -H 'Accept: application/vnd.github.v3+json' | grep '"login":' | sed -e 's/^.*": "//g' -e 's/",.*$//g')
if [[ $lookup ]]; then
@@ -45,8 +42,10 @@ function get_minecraft_versions() {
echo "${minecraft_versions}"
}
previous_tag=$(git describe --tags --abbrev=0 @^)
# Use formatted log to pull authors list
authors_raw=$(git log --pretty=format:"%ae|%an" "$(git describe --tags --abbrev=0 @^)"..@)
authors_raw=$(git log --pretty=format:"%ae|%an" "$previous_tag"..@)
readarray -t authors <<<"$authors_raw"
# Use associative array to map email to author name
@@ -69,7 +68,7 @@ for author in "${authors[@]}"; do
done
# Fetch actual formatted changelog
changelog=$(git log --pretty=format:"* %s (%h) - %ae" "$(git describe --tags --abbrev=0 @^)"..@)
changelog=$(git log --pretty=format:"* %s (%h) - %ae" "$previous_tag"..@)
for author_email in "${!author_data[@]}"; do
# Ignore case when matching