-
Select Topic AreaGeneral BodyI am reaching out for help in creating an Action on GitHub. I am looking to automate the process using GitHub Actions. Specifically, when I merge any branch into the master branch (1.19.3), I want the Action to: Create a new release release example I found this that could help but I can't implement it |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 43 replies
-
Good day to you @vindocel Here is some name: Release
on:
push:
branches:
- master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FILE_NAME: "Dark-Everywhere"
FILE_EXTENSION: ".zip"
BRANCHES: "1.19.3,1.19,1.18"
PACKAGE_NAME: "assets,pack.mcmeta,pack.png"
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Create a release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }}
with:
tag_name: "v${{ env.TAG_NAME }}"
release_name: "Dark Everywhere ${{ env.TAG_NAME }}🌙"
draft: false
prerelease: false
- name: Generate a zip archive for each branch
run: |
for branch in $(echo $BRANCHES | tr "," "\\n"); do
zip -r "$FILE_NAME-$branch$FILE_EXTENSION" $PACKAGE_NAME
done
- name: Upload files
uses: actions/upload-artifact@v2
with:
name: "$FILE_NAME-$branch$FILE_EXTENSION"
path: "$FILE_NAME-$branch$FILE_EXTENSION"
- name: Update release
uses: actions/update-release@v1
env:
GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }}
with:
release_id: ${{ env.RELEASE_ID }}
body: "Build description here" |
Beta Was this translation helpful? Give feedback.
Good day to you @vindocel Here is some
pseudocode
-> (its up to you to finish) you can play with. It is not finished but a start for you. Aslo refer here for additonal help Github Actions