Compare commits

...

3 commits

Author SHA1 Message Date
Muhammad Atif Ali ccc49c4662
Rename update-main-version to update-main-version.yaml 2024-05-23 12:06:59 +03:00
Muhammad Atif Ali c468103ff6
Delete .github/workflows/release.yaml
We are moving to manual releases.
2024-05-23 12:04:42 +03:00
Muhammad Atif Ali 2909d6cadc
Create update-main-version 2024-05-23 12:02:21 +03:00
2 changed files with 30 additions and 38 deletions

View file

@ -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 }}

View 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