Skip to content

Commit

Permalink
ci: combine workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
TillaTheHun0 committed Nov 28, 2023
1 parent 6daead1 commit 01722ec
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 59 deletions.
52 changes: 0 additions & 52 deletions .github/workflows/tag-and-release.yml

This file was deleted.

50 changes: 43 additions & 7 deletions .github/workflows/test-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,17 @@ on:
push:
branches:
- main
tags:
- '*'

# Perform a release using a workflow dispatch
workflow_dispatch:
inputs:
# See https://github.com/hyper63/hyper-ci-bump#inputs for available inputs for the bump action
version:
description: the semver version to bump to
required: true

jobs:

test:
runs-on: ubuntu-latest
strategy:
Expand All @@ -33,14 +40,43 @@ jobs:
CI: true

publish:
if: startsWith(github.ref, 'refs/tags/v')
needs: [test]
# Releases are performed via a workflow dispatch
if: github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
needs: [test]
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: 👀 Env
run: |
echo "Event name: ${{ github.event_name }}"
echo "Git ref: ${{ github.ref }}"
echo "GH actor: ${{ github.actor }}"
echo "SHA: ${{ github.sha }}"
VER=`node --version`; echo "Node ver: $VER"
VER=`npm --version`; echo "npm ver: $VER"
- name: 🦕 Setup Deno
uses: denoland/setup-deno@v1
- name: 🤓 Set Git User
run: |
git config --global user.name "${{ github.actor }}"
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
- name: ✊ Bump
id: bump
uses: hyper63/hyper-ci-bump@main
with:
bump-to: ${{ github.event.inputs.version }}

- name: ⬆️ Push
run: |
git push
git push --tags
- name: 🤖 Create Github Release
if: steps.bump.outputs.tag
uses: softprops/action-gh-release@v1
with:
deno-version: v1.x
tag_name: ${{ steps.bump.outputs.tag }}

0 comments on commit 01722ec

Please sign in to comment.