Skip to content

Commit

Permalink
ci: 💚 update ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Xminent committed Jan 19, 2024
1 parent 0257d65 commit 75d28ed
Showing 1 changed file with 7 additions and 27 deletions.
34 changes: 7 additions & 27 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ on:
env:
BRANCH_NAME: ${{ github.ref == 'refs/heads/dev' && 'dev' || 'main' }}
PRERELEASE: ${{ github.ref == 'refs/heads/dev' && 'true' || 'false' }}
TAG_SUFFIX: ${{ github.ref == 'refs/heads/dev' && '-dev' || '' }}

jobs:
linux:
Expand Down Expand Up @@ -137,39 +136,21 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Get Latest Tag
id: latest-tag
run: |
if [[ "${{ github.ref }}" == 'refs/heads/dev' ]]; then
latest_tag=$(git tag -l | grep "\-dev" | sort -V | tail -n 1 || true)
latest_tag=${latest_tag%-dev}
else
latest_tag=$(git tag -l | grep -v "\-dev" | sort -V | tail -n 1 || true)
fi
if [[ -z $latest_tag ]]; then
latest_tag=""
fi
echo "::set-output name=tag::$latest_tag"
shell: bash

- name: Get Next Version
id: semver
uses: ietf-tools/semver-action@v1
with:
token: ${{ github.token }}
branch: ${{ env.BRANCH_NAME }}
fromTag: ${{ steps.latest-tag.outputs.tag }}

- name: Create Draft Release
uses: ncipollo/release-action@v1.12.0
with:
prerelease: ${{ env.PRERELEASE }}
prerelease: true
draft: false
commit: ${{ github.sha }}
tag: ${{ steps.semver.outputs.next }}${{ env.TAG_SUFFIX }}
name: ${{ steps.semver.outputs.next }}${{ env.TAG_SUFFIX }}
tag: ${{ steps.semver.outputs.next }}
name: ${{ steps.semver.outputs.next }}
body: "*pending*"
token: ${{ github.token }}

Expand All @@ -178,8 +159,7 @@ jobs:
uses: requarks/changelog-action@v1
with:
token: ${{ github.token }}
fromTag: ${{ steps.semver.outputs.next }}${{ env.TAG_SUFFIX }}
toTag: ${{ steps.semver.outputs.current }}${{ env.TAG_SUFFIX }}
tag: ${{ steps.semver.outputs.next }}
writeToFile: false

- name: Create Release
Expand All @@ -190,8 +170,8 @@ jobs:
draft: false
makeLatest: true
commit: ${{ github.sha }}
tag: ${{ steps.semver.outputs.next }}${{ env.TAG_SUFFIX }}
name: ${{ steps.semver.outputs.next }}${{ env.TAG_SUFFIX }}
tag: ${{ steps.semver.outputs.next }}
name: ${{ steps.semver.outputs.next }}
body: ${{ steps.changelog.outputs.changes }}
token: ${{ github.token }}

Expand All @@ -215,4 +195,4 @@ jobs:
repo_token: ${{ github.token }}
file_glob: true
file: "**/*"
tag: ${{ needs.release.outputs.next }}${{ env.TAG_SUFFIX }}
tag: ${{ needs.release.outputs.next }}

0 comments on commit 75d28ed

Please sign in to comment.