diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..a787d97 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,45 @@ +# Creates a new bugfix release whenever a push is made to master. + +name: release + +# Controls when the action will run. +on: + push: + branches: + - master + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + release: + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + + - name: Calculate next version + run: | + git pull + export CURRENT_VERSION=$(cat version.txt) + export THIS_VERSION=$(echo $CURRENT_VERSION | awk -F. -v OFS=. '{$NF++;print}') + echo "THIS_VERSION=$THIS_VERSION" >> $GITHUB_ENV + + - name: Store next version + run: | + echo ${{ env.THIS_VERSION }} > version.txt + + git config user.name "GitHub Actions" + git config user.email "actions@users.noreply.github.com" + git commit -am "Automated release - advance the release version." + git push + + - name: Cut release + uses: softprops/action-gh-release@91409e712cf565ce9eff10c87a8d1b11b81757ae + with: + tag_name: v${{ env.THIS_VERSION }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.rst b/README.rst index 6969a27..7be9ce9 100644 --- a/README.rst +++ b/README.rst @@ -5,6 +5,10 @@ Full Iris test data. This repository includes artificially created data. +Pushes to ``master`` branch (i.e. pull request merges) will trigger an +automatic increment of iris-test-data's minor release version (via a GitHub +Action). + .. |copy| unicode:: U+000A9 .. COPYRIGHT SIGN @@ -12,13 +16,13 @@ Data found in this repository are licensed under the UK's Open Government Licenc Documentation, example and data license --------------------------------------- - + |copy| British Crown copyright, 2021. - - You may use and re-use the information featured in this repository (not including logos) free of - charge in any format or medium, under the terms of the - `Open Government Licence `_. + + You may use and re-use the information featured in this repository (not including logos) free of + charge in any format or medium, under the terms of the + `Open Government Licence `_. We encourage users to establish hypertext links to this website. - - Any email enquiries regarding the use and re-use of this information resource should be + + Any email enquiries regarding the use and re-use of this information resource should be sent to: psi@nationalarchives.gsi.gov.uk.