Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add automatic tagging workflow #32

Merged
merged 3 commits into from
Aug 8, 2023
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
39 changes: 39 additions & 0 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Tag

on:
push:
branches:
- main

permissions:
contents: write

jobs:
tag:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
sparse-checkout: package.json

- name: Check version
id: version
run: |
set -e -o pipefail
BEFORE_VERSION=$(git show "${{ github.event.before }}:package.json" | jq -r .version)
AFTER_VERSION=$(git show "${{ github.event.after }}:package.json" | jq -r .version)

if [ "$BEFORE_VERSION" != "$AFTER_VERSION" ]; then
echo "Version changed from $BEFORE_VERSION to $AFTER_VERSION"
echo "version=$AFTER_VERSION" >> "$GITHUB_OUTPUT"
fi

- name: Tag version
if: ${{ steps.version.outputs.version }}
run: |
set -e -o pipefail
git tag "${{ steps.version.outputs.version }}" "${{ github.event.after }}"
git push origin "${{ steps.version.outputs.version }}"
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ pull request.

Once the pull request is merged, update the GitHub-based dependency in the website and extension:

- Website: `cd apps/website && pnpm remove @alveusgg/data && pnpm add github:alveusgg/data`
- Extension: `npm install github:alveusgg/data`
- Website: `cd apps/website && pnpm add github:alveusgg/data#<version>`
- Extension: `npm install github:alveusgg/data#<version>`
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@alveusgg/data",
"version": "0.18.0",
"version": "0.18.1",
"private": true,
"license": "SEE LICENSE IN LICENSE.md",
"repository": {
Expand Down