Skip to content

Commit

Permalink
Merge pull request #123 from casswedson/releaser-touchup
Browse files Browse the repository at this point in the history
general ci updates + clean up root directory
  • Loading branch information
John-Candlebury authored Oct 24, 2022
2 parents 7862454 + 84671f2 commit 624c56d
Show file tree
Hide file tree
Showing 19 changed files with 51 additions and 45 deletions.
35 changes: 19 additions & 16 deletions .github/workflows/ci_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,37 +17,40 @@ jobs:
build:
name: CI Build
runs-on: ubuntu-latest
container: alpine:latest
steps:
- name: Install Dependencies
run: |
apk add --no-cache musl-dev gcc vips-dev python3-dev py3-pip py3-wheel
pip3 install pyvips
uses: awalsh128/cache-apt-pkgs-action@v1
with:
packages: musl python3 python3-pip libvips42

# re-installing libvips; caching it won't set it up the way we need it
# still cache it because we'll make it work somehow
- run: sudo apt-get install libvips42
- run: pip3 install pyvips

- name: Checkout Code
uses: actions/checkout@v2
- name: Build
id: build
run: |
mkdir build
wget -q -P build https://raw.githubusercontent.com/CleverRaven/Cataclysm-DDA/master/tools/gfx_tools/compose.py \
wget -q https://raw.githubusercontent.com/CleverRaven/Cataclysm-DDA/master/tools/gfx_tools/compose.py \
|| echo "Error: Failed to get compose.py"
python3 build/compose.py --use-all . build
mkdir build
python3 compose.py --use-all --feedback CONCISE --loglevel INFO . build
artifact_name=Cuteclysm-${GITHUB_SHA::7}
tileset_dir=build
artifact_name=Cuteclysm-dev-git-${GITHUB_SHA::7}
mkdir "$artifact_name"
mv $tileset_dir/*.png "$artifact_name"
mv $tileset_dir/tile_config.json "$artifact_name"
mv ./tileset.txt "$artifact_name"
mv ./fallback.png "$artifact_name"
echo ::set-output name=artifact_name::"$artifact_name"
cp -r build/* "$artifact_name"
mv ./tileset.txt "$artifact_name"
mv ./fallback.png "$artifact_name"
echo "ARTIFACT-NAME=$artifact_name" >> $GITHUB_OUTPUT
- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: ${{ steps.build.outputs.artifact_name }}
path: ${{ steps.build.outputs.artifact_name }}
name: ${{ steps.build.outputs.ARTIFACT-NAME }}
path: ${{ steps.build.outputs.ARTIFACT-NAME }}
60 changes: 32 additions & 28 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# Creates a release using compose.py from https://github.com/CleverRaven/Cataclysm-DDA
#
# This action is runs at 12:00 UTC Sunday
# This action is runs at 20:00 UTC Sunday

name: Publish Release
concurrency: release
on:
schedule:
- cron: '0 12 * * sun'
- cron: '0 20 * * sun'
workflow_dispatch:

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -28,16 +29,16 @@ jobs:
- name: Generate environmental variables
id: generate_env_vars
run: |
echo "::set-output name=tag_name::${{ steps.get-timestamp.outputs.time }}"
echo "::set-output name=release_name::Cuteclysm Release ${{ steps.get-timestamp.outputs.time }}"
echo "TAG-NAME=${{ steps.get-timestamp.outputs.time }}" >> $GITHUB_OUTPUT
echo "RELEASE-TITLE=Cuteclysm Release ${{ steps.get-timestamp.outputs.time }}" >> $GITHUB_OUTPUT
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Check if there is existing git tag
id: tag_check
uses: mukunku/[email protected]
with:
tag: ${{ steps.generate_env_vars.outputs.tag_name }}
tag: ${{ steps.generate_env_vars.outputs.TAG-NAME }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Get Previous tag
Expand All @@ -46,22 +47,22 @@ jobs:
- name: Abort if there are no changes
run: |
# exit 1 if there are no changes, exit 0 if there are changes
git diff ${{ steps.previous_tag.outputs.tag }} | grep ""
git diff ${{ steps.previous_tag.outputs.tag }} | grep -q ""
- name: Push tag
id: tag_version
uses: mathieudutour/[email protected]
if: ${{ steps.tag_check.outputs.exists == 'false' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
custom_tag: ${{ steps.generate_env_vars.outputs.tag_name }}
custom_tag: ${{ steps.generate_env_vars.outputs.TAG-NAME }}
tag_prefix: ""
- name: "Generate release notes"
run: |
gh api \
--method POST \
-H "Accept: application/vnd.github.v3+json" \
/repos/pixel-32/CDDA-tileset/releases/generate-notes \
-f tag_name='${{ steps.generate_env_vars.outputs.tag_name }}' \
/repos/${{github.repository}}/releases/generate-notes \
-f tag_name='${{ steps.generate_env_vars.outputs.TAG-NAME }}' \
-f target_commitish='master' \
-q .body > CHANGELOG.md
- name: Create release
Expand All @@ -71,8 +72,8 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.generate_env_vars.outputs.tag_name }}
release_name: ${{ steps.generate_env_vars.outputs.release_name }}
tag_name: ${{ steps.generate_env_vars.outputs.TAG-NAME }}
release_name: ${{ steps.generate_env_vars.outputs.RELEASE-NAME }}
body_path: ./CHANGELOG.md
draft: false
prerelease: false
Expand All @@ -83,42 +84,45 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Install Dependencies
run: |
sudo apt update
sudo apt install musl-dev gcc libvips-dev python3-dev python3-pip python3-wheel
pip3 install pyvips
uses: awalsh128/cache-apt-pkgs-action@v1
with:
packages: musl python3 python3-pip libvips42

# re-installing libvips; caching it won't set it up the way we need it
# still cache it because we'll make it work somehow
- run: sudo apt-get install libvips42
- run: pip3 install pyvips

- name: Checkout Code
uses: actions/checkout@v3
- uses: actions/checkout@v3

- name: Build
id: build
run: |
mkdir build
wget -q -P build https://raw.githubusercontent.com/CleverRaven/Cataclysm-DDA/master/tools/gfx_tools/compose.py \
wget -q https://raw.githubusercontent.com/CleverRaven/Cataclysm-DDA/master/tools/gfx_tools/compose.py \
|| echo "Error: Failed to get compose.py"
python3 build/compose.py --use-all --feedback CONCISE --loglevel INFO . build
mkdir build
python3 compose.py --use-all --feedback CONCISE --loglevel INFO . build
release_name=Cuteclysm
mkdir "$release_name"
cp build/*.png "$release_name"
cp build/tile_config.json "$release_name"
cp -r build/* "$release_name"
cp ./tileset.txt "$release_name"
cp ./fallback.png "$release_name"
[ -f "./layering.json" ] && mv "./layering.json" $release_name
zip -r $release_name.zip $release_name
echo ::set-output name=release_name::"$release_name"
echo "RELEASE-NAME=$release_name" >> $GITHUB_OUTPUT
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: ${{ steps.build.outputs.release_name }}.zip
asset_name: ${{ steps.build.outputs.release_name }}.zip
asset_path: ${{ steps.build.outputs.RELEASE-NAME }}.zip
asset_name: ${{ steps.build.outputs.RELEASE-NAME }}.zip
asset_content_type: application/zip

Binary file removed backdrop.png
Binary file not shown.
Binary file removed backdropoffset.png
Binary file not shown.
Binary file removed creatures.png
Binary file not shown.
Binary file removed expandedcreatures.png
Binary file not shown.
Binary file removed fields.png
Binary file not shown.
Binary file removed fillerItems.png
Binary file not shown.
Binary file removed fillerVehicles.png
Binary file not shown.
Binary file removed hugebackdrop.png
Binary file not shown.
Binary file removed items.png
Binary file not shown.
Binary file removed tallbackdrop.png
Binary file not shown.
Binary file removed tallexpandedcreatures.png
Binary file not shown.
1 change: 0 additions & 1 deletion tile_config.json

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file removed ui.png
Binary file not shown.
Binary file removed ultratallbackdrop.png
Binary file not shown.

0 comments on commit 624c56d

Please sign in to comment.