Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
frasdav committed Dec 26, 2023
1 parent f0fbc3c commit f2b5016
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 22 deletions.
19 changes: 0 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,6 @@ on:
workflow_dispatch:

jobs:
preflight:
runs-on: ubuntu-latest
outputs:
is_pre_release: ${{ steps.get_version.outputs.is_pre_release }}
version: ${{ steps.get_version.outputs.version }}
steps:
- id: get_version
run: |
VERSION="${GITHUB_REF#refs/*/}"
if [[ "$VERSION" =~ ^v\d+\.\d+\.\d+$ ]]; then
IS_PRE_RELEASE="false"
else
IS_PRE_RELEASE="true"
fi
echo "is_pre_release=${IS_PRE_RELEASE}" >> "$GITHUB_OUTPUT"
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
build:
uses: ./.github/workflows/build.yml

Expand Down
42 changes: 39 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,55 @@ name: Release
on:
push:
tags:
- "**"
- "v**"

permissions:
contents: write

jobs:
preflight:
runs-on: ubuntu-latest
outputs:
is_pre_release: ${{ steps.get_version.outputs.is_pre_release }}
version: ${{ steps.get_version.outputs.version }}
steps:
- id: get_version
run: |
VERSION="${GITHUB_REF#refs/*/}"
if [[ "$VERSION" =~ ^v\d+\.\d+\.\d+$ ]]; then
IS_PRE_RELEASE="false"
else
IS_PRE_RELEASE="true"
fi
echo "is_pre_release=${IS_PRE_RELEASE}"
echo "is_pre_release=${IS_PRE_RELEASE}" >> "$GITHUB_OUTPUT"
echo "version=${VERSION}"
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
build:
uses: ./.github/workflows/build.yml
needs: preflight

release:
runs-on: ubuntu-latest
needs: build
needs:
- preflight
- build
steps:
- uses: actions/checkout@v4

- run: echo $GITHUB_REF
- run: |
echo "version=${{ needs.preflight.outputs.version }}"
echo "is_pre_release=${{ needs.preflight.outputs.is_pre_release }}"
# - id: create_release
# uses: actions/create-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# # tag_name: ${{ github.ref }}
# release_name: ${{ needs.preflight.outputs.version }}
# # draft: true
# prerelease: ${{ needs.build.outputs.is_pre_release }}

0 comments on commit f2b5016

Please sign in to comment.