Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexRuiz7 committed Nov 21, 2023
0 parents commit cefdba0
Show file tree
Hide file tree
Showing 69 changed files with 1,143 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dist/
dev/
*.zip
*.log
59 changes: 59 additions & 0 deletions .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Build and release

# This workflow runs when any of the following occur:
# - A tag starting with "v" is created
on:
push:
tags:
- v*

# Used to run locally using https://github.com/nektos/act
env:
ACT:

jobs:
# This pushes the zip to GitHub Packages.
build:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
#
steps:
- uses: actions/checkout@v4

- name: Set up (act)
if: ${{ env.ACT }}
run: |
apt-get update
apt-get install zip make -y
# Builds dist/fh2_matt_bakers_texture_pack_<version>.zip
- name: Build package
run: make

- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: fh2_matt_bakers_texture_pack_${{ github.ref_name }}.zip
path: ./dist/fh2_matt_bakers_texture_pack_${{ github.ref_name }}.zip
if-no-files-found: error

# This creates a draft release.
release:
runs-on: ubuntu-latest
needs: build
permissions:
contents: write
steps:
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: fh2_matt_bakers_texture_pack_${{ github.ref_name }}.zip
- name: Publish release
uses: softprops/action-gh-release@v1
with:
name: Release ${{ github.ref_name }}
generate_release_notes: true
files: fh2_matt_bakers_texture_pack_${{ github.ref_name }}.zip

1 change: 1 addition & 0 deletions .github/workflows/tag.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "ref": "refs/tags/v2.63.0" }
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dist/
dev/
*.zip
*.log
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Changelog

### 2.63
* Added texture pack and tooling.
65 changes: 65 additions & 0 deletions DEVELOPER_GUIDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
## Developer Guide

### Requirements

`bash` and `zip` is all you need to build the package.

```console
bash scripts/pack.sh
```

There is a `Makefile` and a `Dockerfile` to for convenience, but it's not really necessary to use them.


The Dockerfile contains all the requirements to run this software.

- Docker 24.0.0+ (probably works with previous versions too)

Change the version accordingly.
```console
docker build -t fh2-texture-pack:2.63 .
docker run -v "$(pwd)":/app fh2-texture-pack:2.63
```

To test the GitHub actions locally, you will Act:

```console
act -e .github/workflows/tag.json --artifact-server-path dist
```

or using the Make shorthand:

```console
make test
```

Note that it will eventually fail because the GitHub token is not set, but it still useful
to test the workflow locally and find for most of the errors.

### Versioning

The versioning followed in this project follow the mod's versioning to easily identify the
package required for each version of the mod. We use a third number to identify the version of
the package itself, inside the same version of the mod. This is useful to fix bugs or add new
features without having to change the version of the mod itself.

Pattern: `2.XY.Z`, eg: `2.63.0, 2.63.1`

### Releasing a new version

The texture pack might be broken between versions of the mod. Test, and if required fix the
texture pack before generating a release.


1. Bump the version:
```console
bash scripts/version.sh 2.XY.Z
```

2. Create a tag:
```console
git tag -a v2.XY.Z -m "Release v2.XY.Z"
git push origin v2.XY.Z
```

3. If everything goes fine, the release will be created automatically in GitHub.
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM ubuntu:latest
# COPY . /app
RUN apt-get update && apt-get install zip make curl -y
RUN curl -s https://raw.githubusercontent.com/nektos/act/master/install.sh | bash
WORKDIR /app
CMD ["pack"]
ENTRYPOINT [ "make" ]
Loading

0 comments on commit cefdba0

Please sign in to comment.