Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ci): release action #616

Merged
merged 9 commits into from
Nov 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
pull_request:
branches:
- main
workflow_call:

jobs:
build:
Expand Down
53 changes: 53 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Release

permissions:
contents: write

on:
workflow_dispatch:
inputs:
new_version:
description: New version number
required: true
type: string

jobs:
bump_version:
name: Bump version
runs-on: ubuntu-latest
steps:
- name: Check out the code
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- name: Configure Git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Bump Package Version
run: npm version --no-git-tag-version ${{ github.event.inputs.new_version }}
- name: Commit Changes
run: |
git commit -am "chore: bump version to ${{ github.event.inputs.new_version }}"
git push origin HEAD

build_and_push:
name: Build and push
needs: bump_version
uses: ./.github/workflows/push.yml

create_release:
name: Create release
needs: build_and_push
runs-on: ubuntu-latest
steps:
- name: Download "dist" branch
run: curl -s -o spicetify-marketplace.zip https://codeload.github.com/${{ github.repository }}/zip/refs/heads/dist
- name: Publish Release
uses: softprops/action-gh-release@master
with:
tag_name: ${{ github.event.inputs.new_version }}
generate_release_notes: true
files: spicetify-marketplace.zip