Added disclaimer (#10) #8
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: Create Github Release | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
CheckVersion: | |
runs-on: ubuntu-latest | |
outputs: | |
versionChanged: ${{ steps.check_version.outputs.changed }} | |
newVersion: ${{ steps.check_version.outputs.version }} | |
steps: | |
- name: Set up Git repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Check if version has been updated | |
id: check_version | |
uses: EndBug/version-check@v2 | |
with: | |
diff-search: true | |
- name: Log version change | |
if: steps.check_version.outputs.changed == 'true' | |
run: 'echo "Version change found in commit ${{ steps.check_version.outputs.commit }}! New version: ${{ steps.check_version.outputs.version }}"' | |
CreateRelease: | |
needs: CheckVersion | |
if: needs.CheckVersion.outputs.versionChanged == 'true' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Git repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Copy required files to release_files folder | |
run: | | |
mkdir release_files | |
cp ./LICENSE ./release_files/LICENSE | |
cp ./README.md ./release_files/README.md | |
cp ./config.default.json ./release_files/config.default.json | |
cp ./config.schema.json ./release_files/config.schema.json | |
cp ./index.js ./release_files/index.js | |
cp ./package-lock.json ./release_files/package-lock.json | |
cp ./package.json ./release_files/package.json | |
- name: Create .zip of required files | |
run: | | |
cd release_files | |
zip -r ../Game.Pass.API.zip * | |
- name: Create Release notes | |
run: | | |
echo "## What's Changed | |
" > CHANGELOG.md | |
LAST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`) | |
git log --pretty=format:'* %s' $LAST_TAG..HEAD >> CHANGELOG.md | |
- name: Create Release | |
uses: softprops/action-gh-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: v${{ needs.CheckVersion.outputs.newVersion }} | |
name: v${{ needs.CheckVersion.outputs.newVersion }} | |
files: Game.Pass.API.zip | |
body_path: CHANGELOG.md |