Skip to content

Commit c45b513

Browse files
committed
fix cicd
1 parent 28d59b9 commit c45b513

2 files changed

Lines changed: 116 additions & 0 deletions

File tree

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Release starter and migration packages on tag push
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
tags: [ '*' ]
7+
8+
jobs:
9+
zip-and-release-packages:
10+
runs-on: ubuntu-latest
11+
12+
permissions:
13+
contents: write
14+
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v6
18+
19+
- name: Set release version
20+
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
21+
22+
- name: Prepare release folder
23+
run: mkdir packages
24+
25+
- name: Zip starter
26+
uses: montudor/action-zip@v1
27+
with:
28+
args: >
29+
zip -r packages/starter.zip . \
30+
\
31+
-x "*.git/*" \
32+
-x ".github/workflows/build-packages.yml" \
33+
-x ".github/workflows/buildscript-maintenance.yml" \
34+
-x "docs/*" \
35+
\
36+
-x "spotless.importorder" \
37+
-x "CODEOWNERS" \
38+
-x "LICENSE" \
39+
-x "README.md" \
40+
\
41+
-x "packages/" \
42+
-x "packages/starter.zip" \
43+
-x "packages/migration.zip"
44+
45+
- name: Zip migration
46+
uses: montudor/action-zip@v1
47+
with:
48+
args: >
49+
zip -r packages/migration.zip . \
50+
\
51+
-x "*.git/*" \
52+
-x ".github/workflows/build-packages.yml" \
53+
-x ".github/workflows/buildscript-maintenance.yml" \
54+
-x "docs/*" \
55+
-x "src/*" \
56+
\
57+
-x "spotless.importorder" \
58+
-x "CODEOWNERS" \
59+
-x "LICENSE" \
60+
-x "README.md" \
61+
\
62+
-x "packages/" \
63+
-x "packages/starter.zip" \
64+
-x "packages/migration.zip"
65+
66+
- name: Release tag
67+
uses: marvinpinto/action-automatic-releases@latest
68+
with:
69+
repo_token: "${{ secrets.GITHUB_TOKEN }}"
70+
automatic_release_tag: "${{ env.RELEASE_VERSION }}-packages"
71+
prerelease: false
72+
title: "${{ env.RELEASE_VERSION }} starter and migration packages"
73+
files: packages/*
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Buildscript maintenance
2+
3+
on:
4+
push:
5+
branches: [ master, main ]
6+
paths:
7+
- build.gradle
8+
- settings.gradle
9+
workflow_dispatch: { }
10+
11+
jobs:
12+
buildscript-maintenance:
13+
runs-on: ubuntu-latest
14+
if: github.repository == 'GTModpackTeam/Buildscripts'
15+
permissions:
16+
contents: write
17+
pull-requests: write
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v6
21+
22+
- name: Ensure build script version is up to date
23+
id: update-buildscript
24+
run: |
25+
new_version="$(date +%s)"
26+
sed --in-place "1s!^//version:.*!//version: $new_version!g" build.gradle
27+
echo "new_version=$new_version" >> "$GITHUB_OUTPUT"
28+
29+
- name: Create Pull Request
30+
id: create-pull-request
31+
uses: peter-evans/create-pull-request@v8
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
with:
35+
token: ${{ secrets.GITHUB_TOKEN }}
36+
committer: GitHub <noreply@github.com>
37+
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
38+
add-paths: build.gradle
39+
commit-message: '[ci skip] update build script version to ${{ steps.update-buildscript.outputs.new_version }}'
40+
branch: gha-buildscript-maintenance
41+
title: Update build script version to ${{ steps.update-buildscript.outputs.new_version }}
42+
body: This pull request is created by the buildscript-maintenance workflow
43+
labels: ignore changelog

0 commit comments

Comments
 (0)