Skip to content
This repository has been archived by the owner on Jul 12, 2023. It is now read-only.

Commit

Permalink
Update release workflow to fix as many deprecation warnings as possible
Browse files Browse the repository at this point in the history
Still awaiting on the following to fix the final warnings
- jimschubert/query-tag-action#4
- Kir-Antipov/mc-publish#39
  • Loading branch information
ApexModder committed Oct 29, 2022
1 parent db828c8 commit a3fc116
Showing 1 changed file with 70 additions and 24 deletions.
94 changes: 70 additions & 24 deletions .github/workflows/run_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,77 +17,112 @@ jobs:
outputs:
mod_name: ${{ steps.mod_name.outputs.value }}
mod_version: ${{ steps.mod_version.outputs.value }}
mod_curseforge_id: ${{ steps.mod_curseforge_id.outputs.value }}
mod_modrinth_id: ${{ steps.mod_modrinth_id.outputs.value }}
mod_release_type: ${{ steps.mod_release_type.outputs.value }}
minecraft_version: ${{ steps.minecraft_version.outputs.value }}
forge_version: ${{ steps.forge_version.outputs.value }}
tag_current: ${{ steps.tag_current.outputs.tag }}
tag_previous: ${{ steps.tag_previous.outputs.tag }}

steps:
- name: Checkout Repository
uses: actions/checkout@v2
uses: actions/checkout@v3.1.0

- name: Unshallow Repository
run: git fetch --prune --unshallow

- name: Mod Name
id: mod_name
uses: christian-draeger/read-properties@1.0.1
uses: christian-draeger/read-properties@1.1.1
with:
path: ./gradle.properties
property: mod_name
properties: mod_name

- name: Mod Version
id: mod_version
uses: christian-draeger/read-properties@1.0.1
uses: christian-draeger/read-properties@1.1.1
with:
path: ./gradle.properties
property: mod_version
properties: mod_version

- name: CurseForge ID
id: mod_curseforge_id
uses: christian-draeger/read-properties@1.1.1
with:
path: ./gradle.properties
properties: mod_curseforge_id

- name: Modrinth ID
id: mod_modrinth_id
uses: christian-draeger/read-properties@1.1.1
with:
path: ./gradle.properties
properties: mod_modrinth_id

- name: Release Type
id: mod_release_type
uses: christian-draeger/read-properties@1.0.1
uses: christian-draeger/read-properties@1.1.1
with:
path: ./gradle.properties
property: mod_release_type
properties: mod_release_type

- name: Minecraft Version
id: minecraft_version
uses: christian-draeger/read-properties@1.0.1
uses: christian-draeger/read-properties@1.1.1
with:
path: ./gradle.properties
property: minecraft_version
properties: minecraft_version

- name: Forge Version
id: forge_version
uses: christian-draeger/read-properties@1.0.1
uses: christian-draeger/read-properties@1.1.1
with:
path: ./gradle.properties
property: forge_version
properties: forge_version

- name: Find Current Tag
id: tag_current
uses: jimschubert/query-tag-action@v2
with:
include: v*
commit-ish: '@'
skip-unshallow: true

- name: Find Previous Tag
id: tag_previous
uses: jimschubert/query-tag-action@v2
with:
include: v*
exclude: ${{ steps.tag_current.outputs.tag }}
skip-unshallow: true

- name: View Variables
run: |
echo "'mod_name': => '${{ steps.mod_name.outputs.value }}'"
echo "'mod_version': => '${{ steps.mod_version.outputs.value }}'"
echo "'mod_curseforge_id': => '${{ steps.mod_curseforge_id.outputs.value }}'"
echo "'mod_modrinth_id': => '${{ steps.mod_modrinth_id.outputs.value }}'"
echo "'mod_release_type': => '${{ steps.mod_release_type.outputs.value }}'"
echo "'minecraft_version': => '${{ steps.minecraft_version.outputs.value }}'"
echo "'forge_version': => '${{ steps.forge_version.outputs.value }}'"
# Run tests to ensure mod runs fine
tests:
name: Run Project CI Tests
uses: ApexStudios-Dev/.github/.github/workflows/call_tests.yml@master
with:
notification_color: 0x3C40C7
secrets:
DISCORD_CI_WEBHOOK: ${{ secrets.DISCORD_CI_WEBHOOK }}
echo "'tag_current': => '${{ steps.tag_current.outputs.tag }}'"
echo "'tag_previous': => '${{ steps.tag_previous.outputs.tag }}'"
# Generate changelog
changelog:
name: Generate Changelog
uses: ApexStudios-Dev/.github/.github/workflows/call_changelog.yml@master
needs: [ vars ]
with:
tag_current: ${{ needs.vars.outputs.tag_current }}
tag_previous: ${{ needs.vars.outputs.tag_previous }}

# Publish jars to various sources
compile:
name: Compile Project
uses: ApexStudios-Dev/.github/.github/workflows/call_compile.yml@master
needs: [ tests ]
needs: [ vars, changelog ]
secrets:
APEX_MODS_MAVEN_USERNAME: ${{ secrets.APEX_MODS_MAVEN_USERNAME }}
APEX_MODS_MAVEN_PASSWORD: ${{ secrets.APEX_MODS_MAVEN_PASSWORD }}
Expand All @@ -96,7 +131,18 @@ jobs:
publish:
name: Publish Project
uses: ApexStudios-Dev/.github/.github/workflows/call_publish_generic.yml@master
needs: [ compile, changelog ]
needs: [ vars, compile, changelog ]
secrets:
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
with:
mod_name: ${{ needs.vars.outputs.mod_name }}
mod_version: ${{ needs.vars.outputs.mod_version }}
mod_curseforge_id: ${{ needs.vars.outputs.mod_curseforge_id }}
mod_modrinth_id: ${{ needs.vars.outputs.mod_modrinth_id }}
mod_release_type: ${{ needs.vars.outputs.mod_release_type }}
minecraft_version: ${{ needs.vars.outputs.minecraft_version }}
tag_current: ${{ needs.vars.outputs.tag_current }}

# Dispatch mod publish notifications
notify:
Expand All @@ -108,7 +154,7 @@ jobs:
steps:
- name: Download Changelog
if: ${{ (needs.publish.result == 'success') }}
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: changelog
path: .github
Expand Down Expand Up @@ -162,4 +208,4 @@ jobs:
title: '✅️ - **${{ needs.vars.outputs.mod_name }}** - _Published successfully_!'
color: 0x3C40C7
username: ApexStudios
avatar_url: https://i.imgur.com/NkQg4yO.png
avatar_url: https://i.imgur.com/NkQg4yO.png

0 comments on commit a3fc116

Please sign in to comment.