.github/workflows/main.yml #24
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
on: | |
create: | |
tags: | |
- v* | |
schedule: | |
- cron: "0 0 1 */2 *" | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js 18 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x | |
- name: Install dependencies | |
run: | | |
CI=false yarn install | |
- name: Yarn bump patch | |
if: ${{ !startsWith(github.ref, 'refs/tags/v') }} | |
run: | | |
git config user.email "[email protected]" | |
git config user.name "git.action" | |
echo "ref=$(yarn version --patch --json|grep -o '[0-9.]*'|tail -1)" >> "$GITHUB_ENV" | |
- name: Build | |
run: | | |
CI=false yarn build | |
- name: Zip build | |
run: | | |
zip -r build.zip build/ | |
- name: Create Release | |
uses: ncipollo/release-action@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag: ${{ env.ref || github.ref }} | |
# release_name: Release ${{ github.ref }} | |
body: "Build for commit : ${{ github.event.head_commit.message || 'automatic' }}" # TODO: changelog, and build only on tag | |
draft: false | |
prerelease: false | |
artifact: "build.zip" | |