diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 14126717..da407c0b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,12 +2,42 @@ name: Release on: push: - tags: - - '*.*.*' + branches: + - main jobs: release: name: Release runs-on: ubuntu-latest steps: - - uses: hmarr/debug-action@v2 + - uses: actions/checkout@v2 + with: + token: ${{ secrets.RELEASES_GITHUB_TOKEN }} + + - run: npm install + - run: npm run all + + - uses: stefanzweifel/git-auto-commit-action@v4 + with: + file_pattern: dist/** + + - run: node -p "'::set-output name=version::' + require('./package.json').version" + id: version + + - uses: ./ + id: parsedVersion + with: + version: ${{ steps.version.outputs.version }} + + - run: git tag --force ${{ steps.parsedVersion.outputs.major }}.${{ steps.parsedVersion.outputs.minor }}.${{ steps.parsedVersion.outputs.patch }} + - run: git tag --force ${{ steps.parsedVersion.outputs.major }}.${{ steps.parsedVersion.outputs.minor }} + - run: git tag --force ${{ steps.parsedVersion.outputs.major }} + - run: git tag --force 'latest' + + - run: git push --force --tags origin + + - uses: softprops/action-gh-release@v1 + with: + name: ${{ steps.parsedVersion.outputs.major }}.${{ steps.parsedVersion.outputs.minor }}.${{ steps.parsedVersion.outputs.patch }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml deleted file mode 100644 index c7528219..00000000 --- a/.github/workflows/tag.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Tag - -on: - push: - branches: - - main - -jobs: - tag: - name: Tag - runs-on: ubuntu-latest - env: - GIT_AUTHOR_NAME: madhead - GIT_AUTHOR_EMAIL: siarhei.krukau@gmail.com - GIT_COMMITTER_NAME: madhead - GIT_COMMITTER_EMAIL: siarhei.krukau@gmail.com - steps: - - uses: actions/checkout@v2 - with: - token: ${{ secrets.RELEASES_GITHUB_TOKEN }} - - - run: npm install - - run: npm run all - - - uses: stefanzweifel/git-auto-commit-action@v4 - with: - file_pattern: dist/** - - - run: node -p "'::set-output name=version::' + require('./package.json').version" - id: version - - - uses: ./ - id: parsedVersion - with: - version: ${{ steps.version.outputs.version }} - - - run: git tag --force ${{ steps.parsedVersion.outputs.major }}.${{ steps.parsedVersion.outputs.minor }}.${{ steps.parsedVersion.outputs.patch }} - - run: git tag --force ${{ steps.parsedVersion.outputs.major }}.${{ steps.parsedVersion.outputs.minor }} - - run: git tag --force ${{ steps.parsedVersion.outputs.major }} - - run: git tag --force 'latest' - - - run: git push --force --tags origin diff --git a/package-lock.json b/package-lock.json index f118050f..ee079382 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "semver-utils", - "version": "1.3.7", + "version": "1.3.8", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "semver-utils", - "version": "1.3.7", + "version": "1.3.8", "license": "MIT", "dependencies": { "@actions/core": "^1.2.6", diff --git a/package.json b/package.json index 97710178..d611c1b9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "semver-utils", - "version": "1.3.7", + "version": "1.3.8", "private": true, "description": "One-stop shop for working with semantic versions in your workflows", "main": "lib/main.js",