Skip to content

Commit

Permalink
Update build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
ThreeDeeJay authored Sep 7, 2024
1 parent 0af667d commit f09c5e5
Showing 1 changed file with 12 additions and 22 deletions.
34 changes: 12 additions & 22 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Clone repo and submodules
run: git clone --recurse-submodules https://github.com/${{github.repository}}.git . #--branch ${{env.Branch}}

- name: Get current date, commit hash and count
run: |
echo "CommitHashShort=$(git rev-parse --short=8 HEAD)" >> $env:GITHUB_ENV
echo "CommitDate=$(git show -s --date=iso-local --format=%cd)" >> $env:GITHUB_ENV
echo "CommitCount=$(git rev-list --count HEAD)" >> $env:GITHUB_ENV
echo "CommitDate=$(git show -s --date=format:'%Y-%m-%d' --format=%cd)" >> $env:GITHUB_ENV
echo "CommitHashShort=$(git rev-parse --short=7 HEAD)" >> $env:GITHUB_ENV
echo "CommitCount=$(git rev-list --count ${{env.Branch}})" >> $env:GITHUB_ENV
- name: set up JDK 17
uses: actions/setup-java@v3
Expand All @@ -41,26 +42,15 @@ jobs:
- name: List files
run: ls -R

- name: Upload Installer Artifact to GitHub
- name: Upload Artifact to GitHub
uses: actions/upload-artifact@v2
with:
name: "${{github.event.repository.name}}_r${{env.CommitCount}}@${{env.CommitHashShort}}"
path: "${{github.workspace}}/${{env.Artifacts}}/"

- name: GitHub pre-release
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{secrets.GITHUB_TOKEN}}"
automatic_release_tag: "latest"
prerelease: true
title: "[${{env.CommitDate}}] ${{github.event.repository.name}} r${{env.CommitCount}}@${{env.CommitHashShort}}"
files: "${{github.workspace}}/${{env.Artifacts}}"

- name: GitHub pre-release
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{secrets.GITHUB_TOKEN}}"
automatic_release_tag: "r${{env.CommitCount}}"
prerelease: true
title: "[${{env.CommitDate}}] ${{github.event.repository.name}} r${{env.CommitCount}}@${{env.CommitHashShort}}"
files: "${{github.workspace}}/${{env.Artifacts}}"
- name: Release
run: |
gh release create r${{env.CommitCount}} --generate-notes --latest=false --prerelease --title "[${{env.CommitDate}}] ${{github.event.repository.name}} r${{env.CommitCount}}@${{env.CommitHashShort}}"
gh release create latest --generate-notes --latest=false --prerelease --title "[${{env.CommitDate}}] ${{github.event.repository.name}} r${{env.CommitCount}}@${{env.CommitHashShort}}"
gh release upload r${{env.DSOALCommitCount}} "${{github.workspace}}/${{env.Artifacts}}"
gh release upload latest "${{github.workspace}}/${{env.Artifacts}}"

0 comments on commit f09c5e5

Please sign in to comment.