Skip to content

Commit

Permalink
Fix date replacement and manual workflow version (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
neilenns authored Nov 20, 2021
1 parent 93ca512 commit db98d65
Showing 1 changed file with 24 additions and 5 deletions.
29 changes: 24 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,23 @@ jobs:
# Check out the files
- uses: actions/checkout@v2

# Get the version of the GitHub release for use later.
# Get the version of the GitHub release for use later. This is only valid
# when run in a release context
- name: Get GitHub release version
id: get_version
id: get_github_version
uses: battila7/get-version-action@v2
if: startsWith(github.ref, 'refs/tags/')
- name: Store GitHub release version
id: save_github_version
run: echo "version=${{ steps.get_github_version.outputs.version }}" >> $GITHUB_ENV
if: startsWith(github.ref, 'refs/tags/')

# Get the version from the workflow input. This is only valid
# when run manually as a workflow.
- name: Store workflow version
id: save_workflow_version
run: echo "version=${{ github.event.inputs.version }}" >> $GITHUB_ENV
if: startsWith(github.ref, 'refs/tags/') == false

# Get the current date and time, in the timezone specified above, for use later.
- name: Get current date and time
Expand All @@ -50,7 +62,7 @@ jobs:
with:
include: ".*.sch"
find: "%%version%%"
replace: ${{ steps.get_version.outputs.version }}
replace: ${{ env.version }}

- name: Set schematic date
uses: jacobtomlinson/gha-find-replace@v1
Expand All @@ -67,9 +79,16 @@ jobs:
with:
include: ".*.kicad_pcb"
find: "%%version%%"
replace: ${{ steps.get_version.outputs.version }}
replace: ${{ env.version }}

- name: Set PCB date in page settings
uses: jacobtomlinson/gha-find-replace@v1
with:
include: ".*.kicad_pcb"
find: "date %%date%%"
replace: 'date "${{ steps.date.outputs.date }}"'

- name: Set PCB date
- name: Set PCB date on PCB layers
uses: jacobtomlinson/gha-find-replace@v1
with:
include: ".*.kicad_pcb"
Expand Down

0 comments on commit db98d65

Please sign in to comment.