-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (53 loc) · 1.86 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Build on Push
on:
push:
branches:
- main # Adjust this if you want to trigger the workflow on other branches
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write # This allows writing to the repository, needed for creating releases
packages: write
steps:
# Step 1: Checkout the repository
- name: Checkout code
uses: actions/checkout@v4
- name: Create Artifact
id: create_artifact
run: zip -r pack.zip pack.mcmeta data assets
# # Step 2: Upload the folder as a build artifact NOT NEEDED
# - name: Upload artifact
# id: upload_artifact
# uses: actions/upload-artifact@v4
# with:
# name: pack
# path: ./pack.zip
- name: Create Release
id: create_release
uses: actions/create-release@v1
with:
tag_name: 'v${{ github.run_number }}' # You can customize the tag naming
release_name: 'Release ${{ github.run_number }}'
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# # Step 4: Download artifact NOT NEEDED
# - name: Download artifact
# id: download_artifact
# uses: actions/download-artifact@v4
# with:
# name: pack # This should match the name you used in the upload step
# - name: Display structure of downloaded files
# run: ls -R
# Step 5: Upload the pack to the release
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./pack.zip # Path to the zip file you want to upload
asset_name: pack.zip # The name that will be used in the release
asset_content_type: application/zip # Content type of the asset
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}