mirror of
https://github.com/matifali/update-coder-template.git
synced 2024-09-20 06:46:04 +08:00
Compare commits
3 commits
8f1095a1d9
...
ccc49c4662
Author | SHA1 | Date | |
---|---|---|---|
ccc49c4662 | |||
c468103ff6 | |||
2909d6cadc |
38
.github/workflows/release.yaml
vendored
38
.github/workflows/release.yaml
vendored
|
@ -1,38 +0,0 @@
|
||||||
name: Release
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- "v*"
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
# check if tag name has alpha or beta
|
|
||||||
- name: Check if tag name has alpha or beta
|
|
||||||
id: check_tag_name
|
|
||||||
run: |
|
|
||||||
set -euo pipefail
|
|
||||||
if [[ "${{ github.ref }}" =~ -(alpha|beta)- ]]; then
|
|
||||||
echo "PRE_RELEASE=true" >> $GITHUB_OUTPUT
|
|
||||||
else
|
|
||||||
echo "PRE_RELEASE=false" >> $GITHUB_OUTPUT
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Create a pre release if tag name has alpha or beta
|
|
||||||
- name: Create pre release
|
|
||||||
if: steps.check_tag_name.outputs.PRE_RELEASE == 'true'
|
|
||||||
run: gh release create ${{ github.ref }} -t ${{ github.ref_name }} --prerelease --generate-notes -R ${{ github.repository }}
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
# Create release
|
|
||||||
- name: Create release
|
|
||||||
if: steps.check_tag_name.outputs.PRE_RELEASE == 'false'
|
|
||||||
run: gh release create ${{ github.ref }} -t ${{ github.ref_name }} --generate-notes -R ${{ github.repository }}
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
30
.github/workflows/update-main-version.yaml
vendored
Normal file
30
.github/workflows/update-main-version.yaml
vendored
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
name: Update Main Version
|
||||||
|
run-name: Move ${{ github.event.inputs.major_version }} to ${{ github.event.inputs.target }}
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
target:
|
||||||
|
description: The tag or reference to use
|
||||||
|
required: true
|
||||||
|
major_version:
|
||||||
|
type: choice
|
||||||
|
description: The major version to update
|
||||||
|
options:
|
||||||
|
- v3
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
tag:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Git config
|
||||||
|
run: |
|
||||||
|
git config user.name "github-actions[bot]"
|
||||||
|
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||||
|
- name: Tag new target
|
||||||
|
run: git tag -f ${{ github.event.inputs.major_version }} ${{ github.event.inputs.target }}
|
||||||
|
- name: Push new tag
|
||||||
|
run: git push origin ${{ github.event.inputs.major_version }} --force
|
Loading…
Reference in a new issue