add release instructions and where to look. (#141) #51
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: "build-release-zip" | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- 'v[0-9]+.[0-9]+.[0-9]+' | |
jobs: | |
build-release-zip: | |
name: Build release zip | |
runs-on: 'ubuntu-latest' | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # we want to collect tag info, so clone all history | |
- name: Checkout dqx-translation-project/dqx_translations | |
uses: actions/checkout@v4 | |
with: | |
repository: 'dqx-translation-project/dqx_translations' | |
path: 'dqx_translations' | |
- name: Checkout dqx-translation-project/dqx-custom-translations | |
uses: actions/checkout@v4 | |
with: | |
repository: 'dqx-translation-project/dqx-custom-translations' | |
path: 'dqx-custom-translations' | |
- name: Update GITHUB_ENV env | |
run: | | |
echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV | |
echo "CURRENT_TAG=`git describe --always --tags $(git rev-list --tags) | grep -v 'dev' | grep -E '^v' | head -n1 | cut -d"-" -f1`" >> $GITHUB_ENV | |
echo "NEW_TAG=`echo ${GITHUB_REF} | cut -d"/" -f3`" >> $GITHUB_ENV | |
- name: Bump version.update | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: echo $GITHUB_REF | cut -d"v" -f2 > version.update | |
- name: Build package | |
run: | | |
rsync -av --exclude="imgs/" app/* dqxclarity/; | |
cp version.update requirements.txt user_settings.ini dqxclarity/; | |
cp clarity_dialog.db dqxclarity/misc_files; | |
cp -fr dqx-custom-translations/json/* dqxclarity/misc_files; | |
cp -f dqx-custom-translations/csv/* dqxclarity/misc_files; | |
cp -f dqx_translations/json/_lang/en/eventTextSysQuestaClient.json dqxclarity/misc_files; | |
cp -f dqx_translations/json/_lang/en/subPackage05Client.json dqxclarity/misc_files; | |
cp -f dqx_translations/json/_lang/en/subPackage41Client.win32.json dqxclarity/misc_files; | |
cp -f dqx_translations/json/_lang/en/subPackage02Client.win32.json dqxclarity/misc_files; | |
cp -f dqx_translations/json/_lang/en/smldt_msg_pkg_NPC_DB.win32.json dqxclarity/misc_files; | |
- name: Zip package (pre-release) | |
if: startsWith(github.ref, 'refs/tags/v') != true | |
run: zip -r dqxclarity-dev-$SHORT_SHA.zip dqxclarity | |
- name: Zip package (release) | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: zip -r dqxclarity.zip dqxclarity | |
- name: Cleanup existing assets from dev release | |
if: startsWith(github.ref, 'refs/tags/v') != true | |
uses: mknejp/delete-release-assets@v1 | |
continue-on-error: true # tag or assets may not exist | |
with: | |
token: ${{ github.token }} | |
tag: ${{ env.CURRENT_TAG }}-dev | |
assets: '*.zip' | |
- name: Creating dev release | |
if: startsWith(github.ref, 'refs/tags/v') != true | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: dqxclarity-dev-${{ env.SHORT_SHA }}.zip | |
prerelease: true | |
tag_name: ${{ env.CURRENT_TAG }}-dev | |
name: 'Dev Build: ${{ env.CURRENT_TAG }}-dev' | |
body: "This is a pre-release build! You don't want to download this!" | |
- name: Commit version.update to main | |
if: startsWith(github.ref, 'refs/tags/v') | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
id: auto-commit-action | |
with: | |
commit_message: 'Automated bump of version.update' | |
file_pattern: 'version.update' | |
branch: main | |
# probably a better way to do this. big no-no to move an existing tag, | |
# but there's no malicious stuff going on here. we just want the tag | |
# to include the updated version.update file and we're doing it strictly | |
# in CI. the tag is what triggers these steps and I don't want to manually | |
# update the version.update file before pushing the tag. | |
- name: Include previous commit in new tag | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: | | |
git checkout ${{ steps.auto-commit-action.outputs.commit_hash }} | |
git tag -f $NEW_TAG | |
git push --force origin $NEW_TAG | |
- name: Creating prod release | |
if: startsWith(github.ref, 'refs/tags/v') | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: dqxclarity.zip | |
prerelease: false | |
draft: false | |
tag_name: ${{ github.ref }} | |
name: 'Release: ${{ env.NEW_TAG }}' # github.ref does not trim refs/tags/ when used here | |
generate_release_notes: true |