Skip to content

Commit c555efe

Browse files
committed
add github action for publishing release to github
1 parent 3c42175 commit c555efe

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

.github/workflows/release.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# This workflow creates a zip file of the Chrome extension and publishes it as a GitHub release.
2+
#
3+
# To trigger this workflow:
4+
# 1. Create a version tag: git tag v1.0
5+
# 2. Push the tag: git push origin v1.0
6+
#
7+
# The workflow will automatically create a release with the extension zip file attached.
8+
9+
name: Create Release
10+
11+
on:
12+
push:
13+
tags:
14+
- 'v*' # Triggers on version tags like v1.0, v1.0.0, etc.
15+
16+
jobs:
17+
build-and-release:
18+
runs-on: ubuntu-latest
19+
20+
permissions:
21+
contents: write # Required for creating releases
22+
23+
steps:
24+
- name: Checkout code
25+
uses: actions/checkout@v4
26+
27+
- name: Get version from tag
28+
id: get_version
29+
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
30+
31+
- name: Create extension zip
32+
run: |
33+
# Create a zip file with the extension files
34+
# Exclude git files, workflows, and other non-essential files
35+
zip -r jank-simulator-${{ steps.get_version.outputs.VERSION }}.zip \
36+
manifest.json \
37+
background.js \
38+
content.js \
39+
popup.html \
40+
popup.js \
41+
index.html \
42+
icons/ \
43+
LICENSE \
44+
README.md \
45+
-x "*.git*" "*.github/*"
46+
47+
- name: Create Release
48+
uses: softprops/action-gh-release@v1
49+
with:
50+
files: jank-simulator-${{ steps.get_version.outputs.VERSION }}.zip
51+
generate_release_notes: true
52+
draft: false
53+
prerelease: false
54+
env:
55+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)