Skip to content

Commit

Permalink
ci: generate nightly version string from date and time
Browse files Browse the repository at this point in the history
  • Loading branch information
nhedger committed Nov 8, 2023
1 parent 918adb1 commit d57244e
Showing 1 changed file with 4 additions and 21 deletions.
25 changes: 4 additions & 21 deletions .github/workflows/_package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,6 @@ jobs:
- name: Setup
uses: ./.github/actions/setup

- name: Retrieve version from package.json (nightly)
if: ${{ github.event.inputs.nightly }}
id: packageJsonVersion
run: echo "version=$(jq -r '.version' package.json)" >> "$GITHUB_OUTPUT"

- name: Parse version
if: ${{ github.event.inputs.nightly }}
id: version
uses: madhead/[email protected]
with:
version: "${{ steps.packageJsonVersion.outputs.version }}"

- name: Replace name in package.json (nightly)
if: ${{ github.event.inputs.nightly }}
run: |
Expand All @@ -53,21 +41,16 @@ jobs:
jq '.displayName = "Biome (nightly)"' package.json > $tempfile
mv $tempfile package.json
- name: Generate nightly identifier (nightly)
if: ${{ github.event.inputs.nightly }}
id: nightly-identifier
run: echo "identifier=$(date +'%Y%m%d%H')" >> "$GITHUB_OUTPUT"

- name: Build nightly version string (nightly)
- name: Generate nightly version identifier (nightly)
if: ${{ github.event.inputs.nightly }}
id: version-string
run: echo "version=${{ steps.version.outputs.major }}.${{ steps.version.outputs.minor }}.${{ steps.nightly-identifier.outputs.identifier }}" >> $GITHUB_OUTPUT
id: nightly-version
run: echo "version=$(date +'%Y.%m.%d%H%M')" >> "$GITHUB_OUTPUT"

- name: Replace version in package.json (nightly)
if: ${{ github.event.inputs.nightly }}
run: |
tempfile=$(mktemp)
jq --arg version "${{ steps.version-string.outputs.version }}" '.version = $version' package.json > $tempfile
jq --arg version "${{ steps.nightly-version.outputs.version }}" '.version = $version' package.json > $tempfile
mv $tempfile package.json
- name: Package the extension
Expand Down

0 comments on commit d57244e

Please sign in to comment.