Skip to content

Commit

Permalink
Merge pull request #9 from futabooo/create-release-workflow
Browse files Browse the repository at this point in the history
create release workflow
  • Loading branch information
futabooo committed Apr 5, 2024
2 parents 285bec8 + 1e90914 commit df7bb3f
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 1 deletion.
35 changes: 35 additions & 0 deletions .github/actions/release/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Release
description: create a GitHub Release and upload artifacts

inputs:
tag:
description: "The tag name of the release"
required: true

runs:
using: "composite"
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 18

- name: Install dependencies
run: npm ci

- name: Build project
run: npm run build

- name: Zip artifacts
run: |
zip -r notoin-bar-colorize.zip dist/
- name: Release
uses: softprops/action-gh-release@v2
with:
files: notoin-bar-colorize.zip
body_path: CHANGELOG.md
tag_name: ${{ inputs.tag }}
36 changes: 36 additions & 0 deletions .github/workflows/tagpr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: tagpr

on:
push:
branches:
- main

jobs:
tagpr:
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: write
pull-requests: write
issues: read

steps:
- name: Checkout
uses: actions/checkout@v4
- uses: Songmu/tagpr@v1
id: tagpr
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

release:
needs: [tagpr]
if: needs.tagpr.outputs.tag != ''
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: write

steps:
- uses: ./.github/actions/release
with:
tag: ${{ needs.tagpr.outputs.tag }}
5 changes: 5 additions & 0 deletions .tagpr
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[tagpr]
vPrefix = false
releaseBranch = main
versionFile = vite.config.ts,package.json
release = false
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "notion-bar-colorize",
"private": true,
"version": "0.0.0",
"version": "1.0.0",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down

0 comments on commit df7bb3f

Please sign in to comment.