chore: fix github actions #2
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: Release - Build Artifacts, Tag, and Release | |
on: | |
workflow_dispatch: | |
push: | |
branches: ['release'] | |
jobs: | |
create-new-release-version: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
persist-credentials: false | |
- name: Install dependencies | |
run: yarn | |
- name: Get current package version | |
id: package-version | |
run: | | |
version=$( jq -r .version package.json) | |
echo "current-version=${version}" >> "$GITHUB_OUTPUT" | |
- name: Build App | |
run: | | |
yarn build | |
cd build | |
tar czf ott-web-app-build-${{steps.package-version.outputs.current-version}}.tar.gz public | |
zip -r ott-web-app-build-${{steps.package-version.outputs.current-version}}.zip public | |
- name: Parse Changelog Entry | |
id: changelog-reader | |
uses: coditory/changelog-parser@v1 | |
with: | |
version: ${{ steps.package-version.outputs.current-version }} | |
- name: Append Release Notes | |
run: | | |
cat <<EOT >> .github/RELEASE_BODY_TEMPLATE.md | |
${{ steps.changelog-reader.outputs.description }} | |
EOT | |
echo "Appended release notes" | |
- name: Create Tag | |
run: git tag ${{ steps.package-version.outputs.current-version }} | |
- name: Release | |
uses: ncipollo/release-action@v1.13.0 | |
if: ${{ steps.package-version.outputs.current-version }} | |
with: | |
commit: 'release' | |
artifacts: 'build/ott-web-app-build-*.tar.gz, build/ott-web-app-build-*.zip' | |
tag: v${{ steps.package-version.outputs.current-version }} | |
bodyFile: '.github/RELEASE_BODY_TEMPLATE.md' | |
token: ${{ secrets.github_token }} |