Merge branch 'automatic-release-only-on-tags' into ensure-decompilation-tasks-use-toolchain

# Conflicts:
#	.github/workflows/release-packages.yml
This commit is contained in:
Telan committed 2021-11-21 20:56:20 +02:00
commit 76dcb6109e
5 files changed
+78 -54

No files matched your search

+3 -1
View File
@@ -1,11 +1,13 @@
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
name: Build pull request
name: Build and test
on:
pull_request:
branches: [ master, main ]
push:
branches: [ master, main ]
jobs:
build:
@@ -1,29 +1,37 @@
# This workflow only meant for the source mod you shouldn't bring it into your own project
name: Release packages
name: Release starter and migration packages
on:
push:
branches: [ master, main ]
tags:
- '*'
jobs:
zip-packages:
zip-and-release-packages:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set release version
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Prepare release folder
run: |
mkdir packages
- name: Zip starter
uses: montudor/action-zip@v1
with:
args: >
zip -r starter.zip . \
zip -r packages/starter.zip . \
\
-x "*.git/*" \
\
-x ".github/scripts/update-version.sh" \
-x ".github/workflows/buildscript-maintenance.yml" \
-x ".github/workflows/package-release.yml" \
-x ".github/workflows/release-packages.yml" \
-x ".github/workflows/toolchain-compatibility.yml" \
\
-x "*docs/*" \
@@ -33,26 +41,17 @@ jobs:
-x "starter.zip" \
-x "migration.zip"
- name: Publish starter package
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest-stater"
prerelease: true
title: "Latest starter package"
files: "starter.zip"
- name: Zip migration
uses: montudor/action-zip@v1
with:
args: >
zip -r migration.zip . \
zip -r packages/migration.zip . \
\
-x "*.git/*" \
\
-x ".github/scripts/update-version.sh" \
-x ".github/workflows/buildscript-maintenance.yml" \
-x ".github/workflows/package-release.yml" \
-x ".github/workflows/release-packages.yml" \
-x ".github/workflows/toolchain-compatibility.yml" \
\
-x "*docs/*" \
@@ -62,12 +61,21 @@ jobs:
\
-x "starter.zip" \
-x "migration.zip"
- name: Publish migration package
- name: Release under current tag
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest-migration"
prerelease: true
title: "Latest migration package"
files: "migration.zip"
automatic_release_tag: "${{ env.RELEASE_VERSION }}-packages"
prerelease: false
title: "${{ env.RELEASE_VERSION }} starter and migration packages"
files: packages/*
- name: Update latest tag
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest-packages"
prerelease: false
title: "Latest starter and migration packages"
files: packages/*
+42 -29
View File
@@ -1,41 +1,54 @@
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
name: Build and release main branch
name: Release artifacts
on:
push:
branches: [ master, main ]
tags:
- '*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup the workspace
run: ./gradlew setupCIWorkspace
- name: Build the mod
run: ./gradlew build
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: true
title: "Latest Development Build"
files: build/libs/*.jar
- name: Set release version
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Setup the workspace
run: ./gradlew setupCIWorkspace
- name: Build the mod
run: ./gradlew build
- name: Release under current tag
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "${{ env.RELEASE_VERSION }}"
prerelease: false
title: "${{ env.RELEASE_VERSION }}"
files: build/libs/*.jar
- name: Update latest tag
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: false
title: "Latest"
files: build/libs/*.jar