Skip to content

Commit

Permalink
chore: get version from git tag
Browse files Browse the repository at this point in the history
  • Loading branch information
9renpoto committed Dec 15, 2023
1 parent 7ced2d7 commit 4b1e42c
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions .github/workflows/bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,30 @@ jobs:
steps:
- uses: actions/checkout@v4

- run: npm version ${{ inputs.semver }} --no-git-tag-version --workspaces --no-workspaces-update
# - run: npm version ${{ inputs.semver }} --no-git-tag-version --workspaces --no-workspaces-update

# - name: generate new version and save to env variable
# id: get_version
# run: |
# echo "NEW_VERSION=$(cat < apps/web/package.json | jq -r .version)" >> "$GITHUB_OUTPUT"

- name: generate new version and save to env variable
uses: actions/github-script@v7
id: github_releases
with:
result-encoding: string
script: |
const release = await github.rest.repos.getLatestRelease(
{
owner: context.repo.owner,
repo: context.repo.repo,
}
);
return release.data.tag_name;
- name: semver
id: get_version
run: |
echo "NEW_VERSION=$(cat < apps/web/package.json | jq -r .version)" >> "$GITHUB_OUTPUT"
run: echo "NEW_VERSION=$(docker run --rm alpine/semver semver -c -i ${{ inputs.semver }} ${{ steps.github_releases.outputs.result }})" >> "$GITHUB_OUTPUT"

- name: Generate release notes
uses: actions/github-script@v7
Expand Down

0 comments on commit 4b1e42c

Please sign in to comment.