Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/demo #30

Open
wants to merge 23 commits into
base: feature/my-cool-feature
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 29 additions & 11 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@ on:
push:
branches:
- main

jobs:
# This job utilises a marketplace action tag to automatically create a release when a pull request
# is labelled as release:major, release:minor or release:patch (it can also be controlled via commit
# message - see their docs for more info)
#
# Unfortunately it doesn't expose a point at which we can change the files before the Version is
# tagged, so we run it in 'dry-run' mode and expose its outputs for use later if required
check_for_release:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.prerelease.outputs.version }}
release_body: ${{ steps.prerelease.outputs.body }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
Expand All @@ -18,22 +24,34 @@ jobs:
tag_prefix: ""
bump_version_scheme: norelease
dry_run: true

use_github_release_notes: true
# This job only runs if the previous job detects that a new release is required. It checks out the
# main branch of the repo, runs some string replaces via `sed` to bump the version numbers. These
# may be changed to suit your project if required.
#
# @TODO Investigate the possibility of adding a build step between Bump the Version Numbers and
# Create a Github Release. The release action allows for zip artifacts to be uploaded, which may
# be extremely appropriate for distribution.
create_release:
needs: check_for_release
runs-on: ubuntu-latest
if: jobs.check_for_release.outputs.version
if: needs.check_for_release.outputs.version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Check out the repo
uses: actions/checkout@v3


- name: Get current date
id: get_date
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"

- name: Bump the version numbers
run: |
echo "Creating release version ${{ jobs.check_for_release.outputs.version }}"
git checkout
sed -i "s/version\":\ \"[0-9]\+\.\?[0-9]*\.\?[0-9]*/version\":\ \"${{ jobs.check_for_release.outputs.version }}/g" ./defo.txt
sed -i "s/Version:\ [0-9]\+\.\?[0-9]*\.\?[0-9]*/Version:\ ${{ jobs.check_for_release.outputs.version }}/g" ./pie.txt
echo "Creating release version ${{ needs.check_for_release.outputs.version }}"
sed -i "s/version\":\ \"[0-9]\+\.\?[0-9]*\.\?[0-9]*/version\":\ \"${{ needs.check_for_release.outputs.version }}/g" ./package.json
sed -i "s/Version:\ [0-9]\+\.\?[0-9]*\.\?[0-9]*/Version:\ ${{ needs.check_for_release.outputs.version }}/g" ./plugin.php
sed -i "s/\[Unreleased\]/\[${{ needs.check_for_release.outputs.version }}\] ${{steps.get_date.outputs.date}} /g" ./changelog.md
git config user.name "Github Actions"
git config user.email "<>"
git add .
Expand All @@ -43,6 +61,6 @@ jobs:
- name: Create a GitHub release
uses: ncipollo/release-action@v1
with:
tag: ${{ jobs.check_for_release.outputs.version }}
name: ${{ jobs.check_for_release.outputs.version }}
body: ${{ jobs.check_for_release.outputs.version }}
tag: ${{ needs.check_for_release.outputs.version }}
name: ${{ needs.check_for_release.outputs.version }}
body: ${{ needs.check_for_release.outputs.release_body }}
21 changes: 21 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Added
- Some text to Coolfile

## [6.0.0] 2022-09-29
### Changed
- Removed text from coolfile

## [5.1.1] 2022-09-29

### Added
- Initial functionality pre-changelog
- Adding a bit more
### Changed
- moved txt files to appropriately named files
4 changes: 1 addition & 3 deletions coolFile
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
cool
really cool
really really really cool
fghijklmnop
2 changes: 1 addition & 1 deletion defo.txt → package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ascott-analytical-chambers-test-standards",
"version": "5.0.0",
"version": "6.0.0",
"main": "index.js",
"repository": "[email protected]:pieweb/ascott-analytical-chambers-test-standards.git",
"author": "Neil Pie <[email protected]>",
Expand Down
6 changes: 0 additions & 6 deletions pie.txt

This file was deleted.

8 changes: 8 additions & 0 deletions plugin.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php
/*
Plugin Name: Anything
Description: A bespoke plugin to add all functionality
Version: 6.0.0
Author: The team at PIE
Author URI: http://pie.co.de
*/