Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/actions/release/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: release
description: git push a release tag
inputs:
tag-name:
required: true
description: tag name to push
runs:
using: composite
steps:
- id: run
shell: bash
run: ${{ github.action_path }}/run.sh
env:
TAG_NAME: ${{ inputs.tag-name }}
11 changes: 11 additions & 0 deletions .github/actions/release/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
set -o pipefail
set -eux

git add .
git status
git config user.name 'github-actions[bot]'
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
git commit -m "Release $TAG_NAME"
git tag -f "$TAG_NAME"
git push origin -f "$TAG_NAME"
4 changes: 3 additions & 1 deletion .github/workflows/hello-world.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ jobs:
${{ runner.os }}-yarn-
- run: yarn
- run: yarn lint
- run: yarn format-check
- run: yarn test
- run: yarn generate
- run: yarn build
- run: yarn package

- name: e2e-test
uses: ./hello-world
Expand Down
28 changes: 5 additions & 23 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@ name: release

on:
pull_request:
branches:
- main
branches: [main]
paths:
- .github/workflows/release.yaml
push:
branches:
- main
branches: [main]

jobs:
tag:
Expand All @@ -24,24 +22,8 @@ jobs:
restore-keys: |
${{ runner.os }}-yarn-
- run: yarn
- run: yarn workspaces run generate
- run: yarn workspaces run ci:package
- if: github.event_name == 'push'
env:
LATEST_TAG: v1
run: |
set -eux
git add .
git status
git config user.name 'github-actions[bot]'
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
git commit -m "Release $LATEST_TAG"
git tag -f "$LATEST_TAG"
git push origin -f "$LATEST_TAG"

hello-world:
needs: [tag]
runs-on: ubuntu-latest
steps:
- uses: int128/typescript-actions-monorepo/hello-world@v1
uses: ./.github/actions/release
with:
name: bar
tag-name: v1
3 changes: 1 addition & 2 deletions hello-world/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
"lint": "eslint **/*.ts",
"package": "ncc build --source-map --license licenses.txt",
"test": "jest",
"generate": "yarn format && yarn build && yarn package",
"all": "yarn build && yarn format && yarn lint && yarn package && yarn test"
"ci:package": "yarn build && yarn package"
},
"dependencies": {
"@actions/core": "1.3.0"
Expand Down