Trying to fix automatic release #12
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 and Minify Library | |
on: | |
push: | |
branches: | |
- main | |
release: | |
types: | |
- created | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "20.x" | |
- name: Install dependencies | |
run: npm install | |
- name: Build and minify | |
run: npm run build | |
- name: Archive dist | |
uses: actions/upload-artifact@v4 | |
with: | |
name: g-calendar-fetcher-minified | |
path: dist/g-calendar-fetcher.min.js | |
- name: Create Release | |
if: startsWith(github.event.ref, 'refs/tags/v') # Only run for tags | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ github.ref }} | |
draft: false | |
prerelease: false | |
body: | | |
Release of version ${{ github.ref }} | |
## Breaking changes | |
- **[v0.4.0]** Events are now sorted the other way around. Future events are now at the top. | |
- name: Upload Minified Library to Release | |
if: startsWith(github.event.ref, 'refs/tags/v') # Only run for tags | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: dist/g-calendar-fetcher.min.js | |
asset_name: g-calendar-fetcher.min.js | |
asset_content_type: application/javascript |