Skip to content

Commit

Permalink
Update release workflow (#37)
Browse files Browse the repository at this point in the history
This pull request improves the release workflow to make release easier.
  • Loading branch information
tamiroh authored Jan 23, 2024
2 parents 15a1183 + 9e2d104 commit 7051b3e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 17 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ on:
push:
branches:
- main
pull_request:
types: [opened, reopened, synchronize]
workflow_dispatch:

permissions:
contents: read
Expand Down
20 changes: 5 additions & 15 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
name: Release
on:
push:
tags:
- "*"
release:
types: [published]
env:
PLUGIN_NAME: obsidian-interval-timer
jobs:
Expand All @@ -24,22 +23,13 @@ jobs:
zip -r ${{ env.PLUGIN_NAME }}.zip ${{ env.PLUGIN_NAME }}
ls
echo "::set-output name=tag_name::$(git tag --sort version:refname | tail -n 1)"
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.ref }}
name: ${{ github.ref_name }}
generate_release_notes: true
draft: false
prerelease: false
- name: Upload zip file
id: upload-zip
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./${{ env.PLUGIN_NAME }}.zip
asset_name: ${{ env.PLUGIN_NAME }}-${{ steps.build.outputs.tag_name }}.zip
asset_content_type: application/zip
Expand All @@ -49,7 +39,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./main.js
asset_name: main.js
asset_content_type: text/javascript
Expand All @@ -59,7 +49,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./manifest.json
asset_name: manifest.json
asset_content_type: application/json

0 comments on commit 7051b3e

Please sign in to comment.