From 0b657f725fefd94ea8bc9a0cef14f83bce4429e1 Mon Sep 17 00:00:00 2001 From: rickstaa Date: Tue, 22 Dec 2020 21:23:30 +0100 Subject: [PATCH 1/2] :green_heart: Changes versioning scheme and adds automatic versioning gh actions --- .github/workflows/release.yml | 59 +++++++++++++++++++++++++++++++++++ .vscode/settings.json | 17 ++++++++++ README.md | 4 +++ main.code-workspace | 27 ++++++++++++++++ 4 files changed, 107 insertions(+) create mode 100644 .github/workflows/release.yml create mode 100644 .vscode/settings.json create mode 100644 main.code-workspace diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..6cc1a32 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,59 @@ +name: release +on: + push: + branches: + - main + tags: + - 'v*.*.*' + pull_request: + types: + - labeled + +jobs: + release: + if: github.event.action != 'labeled' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + # Bump version on merging Pull Requests with specific labels. + # (bump:major,bump:minor,bump:patch) + - id: bumpr + if: "!startsWith(github.ref, 'refs/tags/')" + uses: haya14busa/action-bumpr@v1 + + # Update corresponding major and minor tag. + # e.g. Update v1 and v1.2 when releasing v1.2.3 + - uses: haya14busa/action-update-semver@v1 + if: "!steps.bumpr.outputs.skip" + with: + tag: ${{ steps.bumpr.outputs.next_version }} + + # Get tag name. + - id: tag + uses: haya14busa/action-cond@v1 + with: + cond: "${{ startsWith(github.ref, 'refs/tags/') }}" + if_true: ${{ github.ref }} + if_false: ${{ steps.bumpr.outputs.next_version }} + + # Create release. + - uses: actions/create-release@v1 + if: "steps.tag.outputs.value != ''" + env: + # This token is provided by Actions, you do not need to create your own token + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ steps.tag.outputs.value }} + release_name: Release ${{ steps.tag.outputs.value }} + body: ${{ steps.bumpr.outputs.message }} + draft: false + prerelease: false + + release-check: + if: github.event.action == 'labeled' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Post bumpr status comment + uses: haya14busa/action-bumpr@v1 \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..19d8961 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,17 @@ +{ + "workbench.colorCustomizations": { + "activityBar.activeBackground": "#ad90bc", + "activityBar.activeBorder": "#e7e2d7", + "activityBar.background": "#ad90bc", + "activityBar.foreground": "#15202b", + "activityBar.inactiveForeground": "#15202b99", + "activityBarBadge.background": "#e7e2d7", + "activityBarBadge.foreground": "#15202b", + "tab.activeBorder": "#ad90bc", + "titleBar.activeBackground": "#9670a9", + "titleBar.activeForeground": "#15202b", + "titleBar.inactiveBackground": "#9670a999", + "titleBar.inactiveForeground": "#15202b99" + }, + "peacock.color": "#9670a9" +} \ No newline at end of file diff --git a/README.md b/README.md index 40e33ae..fde56e7 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,9 @@ # Get previous tag +[![Release](https://github.com/WyriHaximus/github-action-get-previous-tag/workflows/Release/badge.svg)](https://github.com/WyriHaximus/github-action-get-previous-tag/actions?query=workflow%3ARelease) +[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/WyriHaximus/github-action-get-previous-tag?logo=github&sort=semver)](https://github.com/WyriHaximus/github-action-get-previous-tag/releases) + + Github Action that gets the latest tag from git ![Example output showing this action in action](images/output.png) diff --git a/main.code-workspace b/main.code-workspace new file mode 100644 index 0000000..7267f5f --- /dev/null +++ b/main.code-workspace @@ -0,0 +1,27 @@ +{ + "folders": [ + { + "path": "." + }, + { + "path": "../action-get-semver" + } + ], + "settings": { + "workbench.colorCustomizations": { + "activityBar.activeBackground": "#ad90bc", + "activityBar.activeBorder": "#e7e2d7", + "activityBar.background": "#ad90bc", + "activityBar.foreground": "#15202b", + "activityBar.inactiveForeground": "#15202b99", + "activityBarBadge.background": "#e7e2d7", + "activityBarBadge.foreground": "#15202b", + "tab.activeBorder": "#ad90bc", + "titleBar.activeBackground": "#9670a9", + "titleBar.activeForeground": "#15202b", + "titleBar.inactiveBackground": "#9670a999", + "titleBar.inactiveForeground": "#15202b99" + }, + "peacock.color": "#9670a9" + } +} \ No newline at end of file From 45ad6ec53931d02de15ce9b752076ccc4d1e25a8 Mon Sep 17 00:00:00 2001 From: Rick Staa Date: Wed, 23 Dec 2020 12:59:28 +0100 Subject: [PATCH 2/2] :fire: Remove vscode IDE config files --- main.code-workspace | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 main.code-workspace diff --git a/main.code-workspace b/main.code-workspace deleted file mode 100644 index 7267f5f..0000000 --- a/main.code-workspace +++ /dev/null @@ -1,27 +0,0 @@ -{ - "folders": [ - { - "path": "." - }, - { - "path": "../action-get-semver" - } - ], - "settings": { - "workbench.colorCustomizations": { - "activityBar.activeBackground": "#ad90bc", - "activityBar.activeBorder": "#e7e2d7", - "activityBar.background": "#ad90bc", - "activityBar.foreground": "#15202b", - "activityBar.inactiveForeground": "#15202b99", - "activityBarBadge.background": "#e7e2d7", - "activityBarBadge.foreground": "#15202b", - "tab.activeBorder": "#ad90bc", - "titleBar.activeBackground": "#9670a9", - "titleBar.activeForeground": "#15202b", - "titleBar.inactiveBackground": "#9670a999", - "titleBar.inactiveForeground": "#15202b99" - }, - "peacock.color": "#9670a9" - } -} \ No newline at end of file