Skip to content

Commit

Permalink
it just works (tm)
Browse files Browse the repository at this point in the history
  • Loading branch information
FuzzyGamesOn committed Jan 21, 2024
1 parent 9b54d19 commit 61f26bf
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/release_stable.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Create Release - Stable

on:
workflow_dispatch:
inputs:
changelog:
description: 'Changelog'
required: true
type: string

permissions:
actions: read
contents: write

jobs:
create-release:
name: Create stable apworld
runs-on: ubuntu-latest

steps:
- name: Set current date to env
run: |
echo "CURRENT_DATE=$(date +'%Y%m%d')" >> "$GITHUB_ENV"
echo "CURRENT_DATE_VERSION=$(date +'%Y%m%d')" >> "$GITHUB_ENV"
- name: Set expected file basename to env
run: echo "BASENAME=manual_stable_${{ env.CURRENT_DATE }}" >> "$GITHUB_ENV"
- name: Format changelog input as multiline string and put into env
run: |
echo 'CHANGELOG<<EOF' >> "$GITHUB_ENV"
echo "This stable release contains the following changes:\n\n" >> "$GITHUB_ENV"
echo "${{ github.event.inputs.changelog }}" >> "$GITHUB_ENV"
echo "\n\nAs always, report any bugs in our Discord!"
echo 'EOF' >> "$GITHUB_ENV"
- name: Checkout repo
uses: actions/checkout@v3
- name: Change game name and player name to standard names for Manual releases
run: |
tmp=$(mktemp)
jq '.game = "Stable" | .player = "${{ env.CURRENT_DATE }}"' src/data/game.json > "$tmp"
mv "$tmp" src/data/game.json
- name: Create apworld file
# rename src folder, zip it, change extension
run: |
mv src ${{ env.BASENAME }}
zip -r ${{ env.BASENAME }}.zip ${{ env.BASENAME }}/*
mv ${{ env.BASENAME }}.zip ${{ env.BASENAME }}.apworld
- name: Upload apworld as an artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.BASENAME }}.apworld
path: ${{ env.BASENAME }}.apworld
if-no-files-found: error
- name: Add Changelog text to a file for release body, to preserve newlines
run: echo -en "${{ env.CHANGELOG }}" > bodyFile.txt
- name: Create an stable release
uses: ncipollo/release-action@v1
with:
name: "Stable - ${{ env.CURRENT_DATE_VERSION }}"
bodyFile: bodyFile.txt
tag: ${{ env.BASENAME }}
commit: main
artifacts: "${{ env.BASENAME }}.apworld"

0 comments on commit 61f26bf

Please sign in to comment.