This repository has been archived by the owner on Jun 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Автоматизация и защита build artifact
Добавлены workflows на релизы и на commit'ы Версии теперь проставляются почти автоматически Теперь содержимое build artifact запаролен во избежание проблем с антивирусами Обновлены инструкции
- Loading branch information
1 parent
0e0492c
commit 2786359
Showing
11 changed files
with
154 additions
and
28 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Java CI with Gradle | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: benjlevesque/[email protected] | ||
id: short-sha | ||
with: | ||
length: 6 | ||
|
||
- name: Set up JDK 8 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '8' | ||
distribution: 'temurin' | ||
|
||
- name: Setup Gradle | ||
uses: gradle/actions/setup-gradle@v3 | ||
|
||
- name: Build with Gradle Wrapper | ||
run: ./gradlew build | ||
env: | ||
VERSION: ${{ steps.short-sha.outputs.sha }} | ||
|
||
- name: Upload build artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: Package | ||
path: build/libs |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
on: | ||
push: | ||
tags: | ||
- '*' | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
steps: | ||
- name: Get version from tag | ||
id: get_version | ||
run: | | ||
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then | ||
version=${GITHUB_REF#refs/tags/} | ||
else | ||
version=0.0.0.${GITHUB_REF#refs/heads/} | ||
fi | ||
echo "version=${version}" >> "${GITHUB_OUTPUT}" | ||
- uses: actions/checkout@v4 | ||
- name: Set up JDK 8 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '8' | ||
distribution: 'temurin' | ||
|
||
- name: Setup Gradle | ||
uses: gradle/actions/setup-gradle@v3 | ||
|
||
- name: Build with Gradle Wrapper | ||
run: ./gradlew build | ||
env: | ||
VERSION: ${{ steps.get_version.outputs.version }} | ||
|
||
- uses: edgarrc/action-7z@v1 | ||
with: | ||
args: 7z u ./Injector/Injector.7z -p2024 -mhe=on -u- -up1q1r2x1y1z1w1!BetterCSC-${{ steps.get_version.outputs.version }}.7z ./build/libs/* README.md | ||
- uses: edgarrc/action-7z@v1 | ||
with: | ||
args: 7z rn BetterCSC-${{ steps.get_version.outputs.version }}.7z -p2024 -mhe=on README.md Инструкция.txt BetterCSC-Plus-${{ steps.get_version.outputs.version }}.jar Xenoceal/mods/BetterCSC-Plus-${{ steps.get_version.outputs.version }}.jar | ||
|
||
- name: Upload build artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: Package | ||
path: BetterCSC-${{ steps.get_version.outputs.version }}.7z | ||
|
||
upload: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
permissions: write-all | ||
steps: | ||
- name: Get version from tag | ||
id: get_version | ||
run: | | ||
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then | ||
version=${GITHUB_REF#refs/tags/} | ||
else | ||
version=0.0.0.${GITHUB_REF#refs/heads/} | ||
fi | ||
echo "version=${version}" >> "${GITHUB_OUTPUT}" | ||
- name: Check out repository | ||
uses: actions/checkout@v3 | ||
|
||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: Package | ||
|
||
- name: Creating release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: v${{ steps.get_version.outputs.version }} | ||
release_name: Version ${{ steps.get_version.outputs.version }} | ||
body: Пароль от архива 2024 | ||
draft: false | ||
prerelease: false | ||
|
||
- name: Uploading release asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: BetterCSC-${{ steps.get_version.outputs.version }}.7z | ||
asset_name: BetterCSC-${{ steps.get_version.outputs.version }}.7z | ||
asset_content_type: application/java-archive |
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
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
Binary file not shown.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
main=ru.serega007.bcsc.BetterCSC | ||
author=Serega007 | ||
name=BetterCSC | ||
version=2.7.4 | ||
version=@version@ |