minor-update #21
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: minor-update | |
# when to run the workflow | |
on: | |
workflow_dispatch: | |
# instructions the workflow will perform | |
jobs: | |
build: | |
if: github.actor == 'sindre0830' | |
# environment to run on | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
# steps to perform | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: '0' | |
ref: ${{ github.sha }} | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: '3.9' | |
- name: Bump version in About.xml | |
run: | | |
# run versioning script | |
python Scripts/versioning.py minor_update | |
# configure git user | |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git config user.name "github-actions[bot]" | |
# commit and push changes | |
git add . | |
git commit -m "Bump version" | |
git push | |
- name: Update and push tag | |
id: tag | |
uses: anothrNick/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
WITH_V: true | |
DEFAULT_BUMP: "minor" | |
- name: Create zipped folder | |
uses: thedoctor0/[email protected] | |
with: | |
type: 'zip' | |
filename: 'Universum.zip' | |
exclusions: '*.zip* *.git* /*Workshop/* /*Scripts/* /*Source/* /*.github/* .gitignore Changelog.md LICENSE README.md' | |
- name: Create release and attach the zipped folder | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: 'Universum.zip' | |
bodyFile: "Changelog.md" | |
tag: ${{ steps.tag.outputs.new_tag }} | |
- name: Unzip folder to a temporary location | |
run: | | |
sudo apt-get install unzip | |
mkdir Universum/ | |
unzip Universum.zip -d Universum | |
- name: Push folder to steam | |
uses: AnarkisGaming/workshop@v1 | |
env: | |
STEAM_ACCOUNT_NAME: ${{ secrets.accountname }} | |
STEAM_PASSWORD: ${{ secrets.password }} | |
with: | |
appID: 294100 | |
publishedFileID: 2920558019 | |
path: "Universum/" | |
changelog: "New update is out! Check out the changelog [url=https://github.com/RimNauts/Universum/releases]here[/url]" | |
- name: Send message to Discord server | |
uses: Ilshidur/[email protected] | |
env: | |
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} | |
TAG: ${{ steps.tag.outputs.new_tag }} | |
ROLE_ID: ${{ secrets.DISCORD_ROLE }} | |
with: | |
args: "**{{ TAG }}** New update is out! Check out the changelog here <https://github.com/RimNauts/Universum/releases/tag/{{ TAG }}> <@&{{ ROLE_ID }}>" | |
- name: Send Changelog file to Discord server | |
uses: tsickert/[email protected] | |
with: | |
webhook-url: ${{ secrets.DISCORD_WEBHOOK }} | |
filename: Changelog.md | |
- name: Clear ChangeLog.md | |
run: | | |
# remove tmp files created by workflow | |
git clean -fd | |
# update ChangeLog.md | |
echo "# Changelog" > ChangeLog.md | |
echo "" >> ChangeLog.md | |
# configure git user | |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git config user.name "github-actions[bot]" | |
# commit and push changes | |
git add . | |
git commit -m "Update ChangeLog.md" | |
git push |