Skip to content

Commit cc64c81

Browse files
committed
ci: combine workflows
1 parent 9cf4104 commit cc64c81

File tree

2 files changed

+43
-59
lines changed

2 files changed

+43
-59
lines changed

.github/workflows/tag-and-release.yml

-52
This file was deleted.

.github/workflows/test-and-publish.yml

+43-7
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,17 @@ on:
77
push:
88
branches:
99
- main
10-
tags:
11-
- "*"
10+
11+
# Perform a release using a workflow dispatch
12+
workflow_dispatch:
13+
inputs:
14+
# See https://github.com/hyper63/hyper-ci-bump#inputs for available inputs for the bump action
15+
version:
16+
description: the semver version to bump to
17+
required: true
1218

1319
jobs:
20+
1421
test:
1522
runs-on: ubuntu-latest
1623
strategy:
@@ -33,14 +40,43 @@ jobs:
3340
CI: true
3441

3542
publish:
36-
if: startsWith(github.ref, 'refs/tags/v')
37-
needs: [test]
43+
# Releases are performed via a workflow dispatch
44+
if: github.event_name == 'workflow_dispatch'
3845
runs-on: ubuntu-latest
46+
needs: [test]
3947
steps:
4048
- name: ⬇️ Checkout repo
4149
uses: actions/checkout@v3
50+
with:
51+
fetch-depth: 0
52+
53+
- name: 👀 Env
54+
run: |
55+
echo "Event name: ${{ github.event_name }}"
56+
echo "Git ref: ${{ github.ref }}"
57+
echo "GH actor: ${{ github.actor }}"
58+
echo "SHA: ${{ github.sha }}"
59+
VER=`node --version`; echo "Node ver: $VER"
60+
VER=`npm --version`; echo "npm ver: $VER"
4261
43-
- name: 🦕 Setup Deno
44-
uses: denoland/setup-deno@v1
62+
- name: 🤓 Set Git User
63+
run: |
64+
git config --global user.name "${{ github.actor }}"
65+
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
66+
67+
- name: ✊ Bump
68+
id: bump
69+
uses: hyper63/hyper-ci-bump@main
70+
with:
71+
bump-to: ${{ github.event.inputs.version }}
72+
73+
- name: ⬆️ Push
74+
run: |
75+
git push
76+
git push --tags
77+
78+
- name: 🤖 Create Github Release
79+
if: steps.bump.outputs.tag
80+
uses: softprops/action-gh-release@v1
4581
with:
46-
deno-version: v1.x
82+
tag_name: ${{ steps.bump.outputs.tag }}

0 commit comments

Comments
 (0)