Skip to content

Commit

Permalink
Download release of versioner (#2)
Browse files Browse the repository at this point in the history
* Download release of versioner

And leverage that. Only publish tags on master

* Echo working directory

* All work happens in the top level directory

* Echo github workspace for debugging purposes

* Check the downloaded script is correct and run it

* curl -L to follow the redirect

* Echo head ref

* Download newer script version

* Checkout with v2
  • Loading branch information
Dragos Dumitrache authored Mar 2, 2023
1 parent 398b15c commit 6c464ac
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/test-and-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,26 @@ on:
- master
paths-ignore:
- '.github/**'
pull_request:
branches:
- master

jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Run tests
run: |
./run_tests.sh
- uses: ./versioner/
if: github.ref == 'ref/heads/master'
id: versioner
- run: |
- name: publish tag
if: github.ref == 'ref/heads/master'
run: |
git config --global user.email ${{ secrets.EMAIL }}
git config --global user.name ${{ secrets.NAME }}
Expand Down
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"default_branch": "master",
"major": "2",
"minor": "1"
"minor": "2"
}
9 changes: 8 additions & 1 deletion versioner/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,17 @@ outputs:
runs:
using: composite
steps:
- name: Download versioner
shell: bash
working-directory: ${{ github.workspace }}
run: |
curl -o the_versioner -L https://github.com/DragosDumitrache/versioner/releases/download/2.2.0/version.sh
chmod +x the_versioner
- name: Generate and tag a new version
id: semver
working-directory: ${{ github.workspace }}
shell: bash
run: |
version_tag=$(${{ github.action_path }}./versioner/version.sh)
version_tag=$(./the_versioner)
echo "Version is: $version_tag"
echo "version=$(echo $version_tag)" >> $GITHUB_OUTPUT

0 comments on commit 6c464ac

Please sign in to comment.