Skip to content

Commit

Permalink
release engine
Browse files Browse the repository at this point in the history
  • Loading branch information
okibcn authored Feb 8, 2023
1 parent 6690c8c commit 70071ff
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# https://docs.github.com/en/github/administering-a-repository/configuration-options-for-dependency-updates
---
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
# labels:
# - "📦 dependencies"
assignees:
- "okibcn"

75 changes: 75 additions & 0 deletions .github/workflows/Release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Copyright (c) 2023 okibcn
# This is free software, licensed under the GNU General Public License v3.0
# See /LICENSE for more information.
# https://github.com/okibcn/ss
# Description: Prepares package and releases it.

name: Release
on:
# schedule:
# - cron: '52 0 * * *'
# runs at 0:52 UTC every day
workflow_dispatch:
inputs:
debug_enabled:
description: 'Run the build with tmate debugging enabled true/false (default: false)'
required: false
default: 'false'
release:
description: 'Type (yes) for release, (no) will generate an artifact (default: no)'
required: false
default: 'no'

jobs:
build:
runs-on: ubuntu-latest
# Use the Bash shell regardless whether the GitHub Actions runner is ubuntu-latest, macos-latest, or windows-latest
defaults:
run:
shell: bash
steps:
- name: "⏬ Checkout repository"
uses: actions/checkout@v3

- name: "🐞 Debug session"
uses: mxschmitt/action-tmate@v3
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled == 'true'
## More info at https://til.simonwillison.net/github-actions/debug-tmate
## or https://github.com/mxschmitt/action-tmate

- name: "📦 Create Package"
run: |
############################
## ##
## CREATE PACKAGE ##
## ##
############################
cp LICENSE README* -t ss
VERSION=$(cat ss/ss.ps1 | grep -Po "^#.*v([\d\.\-]+)" | grep -Po "([\d\.\-]+)")
7z a "./ss-v$VERSION.7z" ss/*
echo "VERSION=${VERSION}" >>$GITHUB_ENV
- name: "👍 Upload Artifact"
uses: actions/upload-artifact@v3
if: github.event_name == 'workflow_dispatch' && github.event.inputs.release != 'yes'
with:
name: ${{ env.VERSION }}
path: |
*.7z
- name: "🎉 Publish a new release"
uses: softprops/[email protected]
# go to https://github.com/OWNER/REPO/settings/actions and
# in "**"Workflow Permissions" section give actions **Read and Write permissions**.
if: github.event_name != 'workflow_dispatch' || github.event.inputs.release == 'yes'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.VERSION }}
files: ./*.7z
# body: |
# ${{ env.BODY }}

0 comments on commit 70071ff

Please sign in to comment.