fix: Remove redundant checkout step in release.yml for improved clarity #26
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright (c) 2022 Joshua Schmitt | |
# | |
# This software is released under the MIT License. | |
# https://opensource.org/licenses/MIT | |
name: "πΊ Release Build" | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
getinfo: | |
runs-on: ubuntu-latest | |
outputs: | |
tag: ${{ steps.version.outputs.tag }} | |
name: "π Modpack Info" | |
steps: | |
- name: "π Checkout" | |
uses: actions/checkout@v4 | |
- name: "π Get tag" | |
id: version | |
uses: "WyriHaximus/github-action-get-previous-tag@v1" | |
changelog: | |
runs-on: ubuntu-latest | |
name: "π Changelog" | |
outputs: | |
changelog: ${{steps.changelog.outputs.changelog}} | |
steps: | |
- name: "π Checkout" | |
uses: actions/checkout@v4 | |
- name: "ποΈ Build Changelog" | |
id: changelog | |
uses: mikepenz/release-changelog-builder-action@v4 | |
env: | |
GITHUB_TOKEN: ${{ secrets.PROFILE_TOKEN }} | |
build: | |
name: π Build | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
version: [1.16, 1.17, 1.18, 1.19, "1.20", 1.21] | |
include: | |
- version: 1.16 | |
pack_version: 6 | |
latest: false | |
- version: 1.17 | |
pack_version: 7 | |
latest: false | |
- version: 1.18 | |
pack_version: 8 | |
latest: false | |
- version: 1.19 | |
pack_version: 13 | |
latest: false | |
- version: 1.20 | |
pack_version: 32 | |
latest: false | |
- version: 1.21 | |
pack_version: 46 | |
latest: true | |
steps: | |
- name: π Checkout | |
if: ${{ matrix.latest == false }} | |
uses: actions/checkout@v4 | |
with: | |
ref: 'ver/${{ matrix.version }}' | |
- name: π Checkout | |
if: ${{ matrix.latest == true }} | |
uses: actions/checkout@v4 | |
- name: πΎ Update config.json | |
run: echo "`jq '.pack.pack_format=${{ matrix.pack_version }}' pack.mcmeta`" > pack.mcmeta | |
- name: π¦ ZIP | |
uses: vimtor/action-zip@v1 | |
with: | |
files: assets/ pack.mcmeta pack.png credits.md | |
dest: pack.zip | |
- name: πΉ Upload | |
uses: actions/upload-artifact@v3 | |
with: | |
name: JqshuvPack-${{ matrix.version }}.X | |
path: | | |
assets/ | |
pack.mcmeta | |
pack.png | |
credits.md | |
# zip_build: | |
# name: "π Build ZIP Release" | |
# needs: [build] | |
# runs-on: ubuntu-latest | |
# strategy: | |
# matrix: | |
# version: [1.16, 1.17, 1.18, 1.19, "1.20", 1.21] | |
# steps: | |
# - name: "π½ Download Packs" | |
# uses: actions/download-artifact@v3 | |
# with: | |
# name: JqshuvPack-${{ matrix.version }}.X | |
# - name: π¦ ZIP | |
# run: zip -r JqshuvPack-${{ matrix.version }}.X.zip * | |
# - name: πΉ Upload | |
# uses: actions/upload-artifact@v3 | |
# with: | |
# name: packs | |
# path: JqshuvPack-${{ matrix.version }}.X.zip | |
release-github: | |
runs-on: ubuntu-latest | |
needs: [build, changelog, getinfo] | |
name: "π Release to Github" | |
strategy: | |
matrix: | |
version: [1.16, 1.17, 1.18, 1.19, "1.20", 1.21] | |
steps: | |
- name: "π½ Download Packs" | |
uses: actions/download-artifact@v3 | |
with: | |
name: JqshuvPack-${{ matrix.version }}.X | |
- name: π¦ ZIP | |
run: zip -r JqshuvPack-${{ matrix.version }}.X.zip * | |
- name: "π Get release type" | |
id: release-type | |
run: | | |
rel_type="release" | |
case "${{ needs.getinfo.outputs.tag }}" in | |
*alpha*) rel_type="true" ;; | |
*beta*) rel_type="true" ;; | |
*rc**) rel_type="true" ;; | |
*) rel_type="false" ;; | |
esac | |
echo "::set-output name=type::$rel_type" | |
- name: "𧬠Create release" | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
body: ${{ steps.changelog.outputs.changelog }} | |
prerelease: ${{ steps.release-type.outputs.type }} | |
file: JqshuvPack-${{ matrix.version }}.X.zip |