Skip to content

Commit

Permalink
Updating git workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
boiscljo committed Jan 23, 2024
1 parent ae91107 commit 30aaa17
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 48 deletions.
36 changes: 12 additions & 24 deletions .github/workflows/gradle-publish-1.5.7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
distribution: 'adopt'
distribution: 'microsoft'
java-version: 17
cache: 'gradle'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Read value from Properties-file
id: read_property
uses: Reedyuk/[email protected].1
uses: Reedyuk/[email protected].4
with:
path: './gradle.properties'
property: 'SBA_VERSION'
Expand All @@ -36,27 +36,15 @@ jobs:
GITHUB_ACTIONS_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
GITHUB_COMMIT_MESSAGE: "${{ github.event.head_commit.message }}"
- name: Upload the final artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
path: plugin/build/libs/SBA-${{ steps.read_property.outputs.value }}-all.jar
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
- uses: "marvinpinto/action-automatic-releases@latest"
with:
tag_name: ${{ steps.read_property.outputs.value }}.${{ steps.vars.outputs.sha_short }}"
release_name: Release ${{ steps.read_property.outputs.value }}
body: Pre-release of dev version
draft: false
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: true
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: plugin/build/libs/SBA-${{ steps.read_property.outputs.value }}-all.jar
asset_name: SBA-${{ steps.read_property.outputs.value }}-all.jar
asset_content_type: application/java-archive
title: "Release Build ${{ steps.read_property.outputs.value }}"
files: |
LICENSE.txt
*.jar
47 changes: 23 additions & 24 deletions .github/workflows/gradle-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
distribution: 'adopt'
distribution: 'microsoft'
java-version: 17
cache: 'gradle'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Read value from Properties-file
id: read_property
uses: Reedyuk/[email protected].1
uses: Reedyuk/[email protected].4
with:
path: './gradle.properties'
property: 'SBA_VERSION'
Expand All @@ -38,27 +38,26 @@ jobs:
GITHUB_ACTIONS_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
GITHUB_COMMIT_MESSAGE: "${{ github.event.head_commit.message }}"
- name: Upload the final artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
path: plugin/build/libs/SBA-${{ steps.read_property.outputs.value }}-all.jar
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
- uses: "marvinpinto/action-automatic-releases@latest"
with:
tag_name: ${{ steps.read_property.outputs.value }}.${{ steps.vars.outputs.sha_short }}"
release_name: Release ${{ steps.read_property.outputs.value }}
body: Latest release
draft: false
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: plugin/build/libs/SBA-${{ steps.read_property.outputs.value }}-all.jar
asset_name: SBA-${{ steps.read_property.outputs.value }}-all.jar
asset_content_type: application/java-archive
title: "Release Build ${{ steps.read_property.outputs.value }}"
files: |
LICENSE.txt
*.jar
# - name: Upload Release Asset
# id: upload-release-asset
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
# asset_path: plugin/build/libs/SBA-${{ steps.read_property.outputs.value }}-all.jar
# asset_name: SBA-${{ steps.read_property.outputs.value }}-all.jar
# asset_content_type: application/java-archive

0 comments on commit 30aaa17

Please sign in to comment.