mirror of
https://github.com/zephrynis/ptero-sidebar.git
synced 2026-04-17 09:31:55 +00:00
50 lines
1.5 KiB
YAML
50 lines
1.5 KiB
YAML
name: Create Release
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Extract version from conf.yml
|
|
id: get_version
|
|
run: |
|
|
VERSION=$(sed -n 's/^[[:space:]]*version:[[:space:]]*//p' conf.yml | head -n 1)
|
|
VERSION=${VERSION//\"/}
|
|
VERSION=${VERSION//\'/}
|
|
echo "Detected version: $VERSION"
|
|
echo "::set-output name=VERSION::$VERSION"
|
|
|
|
- name: Create zip of project files
|
|
run: |
|
|
zip -r sidebar.blueprint . -x "*.git*"
|
|
|
|
- name: Create Release
|
|
id: create_release
|
|
uses: comnoco/create-release-action@main
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
|
|
with:
|
|
tag_name: ${{ steps.get_version.outputs.VERSION }}
|
|
release_name: Release v${{ steps.get_version.outputs.VERSION }}
|
|
body: "${{ github.event.head_commit.message }}"
|
|
draft: false
|
|
prerelease: false
|
|
|
|
- name: Upload binaries to release
|
|
uses: svenstaro/upload-release-action@v2
|
|
with:
|
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
|
file: sidebar.blueprint
|
|
asset_name: sidebar.blueprint
|
|
tag: ${{ steps.get_version.outputs.VERSION }}
|
|
overwrite: true
|