Skip to content

Commit

Permalink
ci: setup a CI workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
xTVaser committed Nov 3, 2023
1 parent 8ad770e commit 94efd4d
Show file tree
Hide file tree
Showing 2 changed files with 163 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: 🏭 Build Plugin

on:
push:
branches:
- master
pull_request:
branches:
- master

permissions:
contents: write

jobs:
build-plugin:
if: github.repository == 'open-goal/decky-plugin'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: "main"

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
cache: yarn

- name: Install Dependencies
run: |
mkdir ./cli
curl -L -o ./cli/decky "https://github.com/SteamDeckHomebrew/cli/releases/latest/download/decky"
chmod +x ./cli/decky
- name: Create Plugin
run: sudo ./cli/decky plugin build ./
127 changes: 127 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
name: 🏭 Create Release

on:
workflow_dispatch:
inputs:
bump:
description: "Semver Bump Type"
required: true
default: "patch"
type: choice
options:
- "patch"
- "minor"
- "major"

permissions:
contents: write

jobs:
create-tag:
if: github.repository == 'open-goal/decky-plugin'
name: "Create New Tag"
runs-on: ubuntu-latest
outputs:
new_tag: ${{ steps.version_bump.outputs.new_tag }}
steps:
- uses: actions/checkout@v4
# TODO - still have to use PAT to bypass branch protections
# https://github.com/orgs/community/discussions/13836
with:
token: ${{ secrets.BOT_PAT }}

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
cache: yarn

- name: Bump Version
id: version_bump
run: |
yarn version --${{ github.event.inputs.bump }} --no-git-tag-version
echo "new_tag=v${NEW_VERSION}" >> $GITHUB_OUTPUT
- name: Commit Version Bump
uses: EndBug/add-and-commit@v9
with:
default_author: github_actor
author_name: "OpenGOALBot"
author_email: "OpenGOALBot@users.noreply.github.com"
message: "release: bump to version - ${{ steps.version_bump.outputs.new_tag }}"
tag: "${{ steps.version_bump.outputs.new_tag }}"

create-release:
needs: [create-tag]
if: github.repository == 'open-goal/decky-plugin'
name: "Create Release"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: "main"

# Create the release, use `gh` CLI so we can auto generate the notes
- name: Create Release
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release create ${{needs.create-tag.outputs.new_tag}} --generate-notes --draft --repo open-goal/decky-plugin
build-plugin:
if: github.repository == 'open-goal/decky-plugin'
needs: [create-release]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: "main"

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
cache: yarn

- name: Install Dependencies
run: |
mkdir ./cli
curl -L -o ./cli/decky "https://github.com/SteamDeckHomebrew/cli/releases/latest/download/decky"
chmod +x ./cli/decky
- name: Create Plugin
run: sudo ./cli/decky plugin build ./

publish-release:
if: github.repository == 'open-goal/decky-plugin'
needs: [create-release, build-plugin]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: "main"
# TODO - still have to use PAT to bypass branch protections
# https://github.com/orgs/community/discussions/13836
token: ${{ secrets.BOT_PAT }}

- name: setup node
uses: actions/setup-node@v3
with:
node-version: 18
cache: yarn

# - name: update release metadata and publish the release
# env:
# RELEASE_ID: ${{needs.create-release.outputs.release_id}}
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: |
# yarn install --frozen-lockfile
# yarn update-release-meta

# - name: commit release metadata change
# uses: EndBug/add-and-commit@v9
# with:
# default_author: github_actor
# author_name: "OpenGOALBot"
# author_email: "OpenGOALBot@users.noreply.github.com"
# message: "release: update release metadata to latest"

0 comments on commit 94efd4d

Please sign in to comment.