generated from Ed-Fi-Exchange-OSS/Template-for-GitHub
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding code changes on PR to avoid commit directly into main
- Loading branch information
Showing
2 changed files
with
39 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,53 +14,24 @@ env: | |
GITHUB_TOKEN: ${{ secrets.PAT_ATTACH_TO_RELEASE }} | ||
|
||
jobs: | ||
upgrade: | ||
name: Upgrade packages | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: Meadowlark-js | ||
permissions: | ||
contents: write | ||
outputs: | ||
version: ${{ steps.set-version.outputs.version }} | ||
steps: | ||
- name: Checkout the Repo | ||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 | ||
|
||
- name: Update versions | ||
run: npx [email protected] version prerelease --exact --no-git-tag-version --yes | ||
|
||
- name: Set Version | ||
id: set-version | ||
run: | | ||
version=v$(cat lerna.json | jq -r .version) | ||
echo "version=$version" >> "$GITHUB_OUTPUT" | ||
- uses: planetscale/ghcommit-action@4131649dbf2fdf1eb34421702972a5af7b0a8731 # v0.1.18 | ||
with: | ||
commit_message: "${{ steps.set-version.outputs.version }}" | ||
repo: ${{ github.repository }} | ||
branch: ${{ github.head_ref || github.ref_name }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
create-pre-releases: | ||
name: Create Pre-Releases | ||
runs-on: ubuntu-latest | ||
needs: upgrade | ||
defaults: | ||
run: | ||
shell: pwsh | ||
working-directory: Meadowlark-js | ||
steps: | ||
- name: Checkout the Repo | ||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 | ||
with: | ||
# Need full Git history to get the tag version | ||
fetch-depth: 0w | ||
|
||
- name: Create Meadowlark Pre-Release | ||
run: | | ||
$version="${{needs.upgrade.outputs.version}}" | ||
$version=$(git describe --tags) | ||
$body = @{ | ||
tag_name = $version | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -112,6 +112,41 @@ jobs: | |
- name: Linter | ||
run: npm run test:lint | ||
|
||
upgrade: | ||
# Upgrade packages on PR only to avoid a double update when pushed to main | ||
name: Upgrade packages | ||
if: github.event_name == 'pull_request' | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: Meadowlark-js | ||
permissions: | ||
contents: write | ||
outputs: | ||
version: ${{ steps.set-version.outputs.version }} | ||
steps: | ||
- name: Checkout the Repo | ||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 | ||
with: | ||
ref: ${{ github.event.pull_request.head.ref }} | ||
|
||
- name: Update versions | ||
run: npx [email protected] version prerelease --exact --no-git-tag-version --yes | ||
|
||
- name: Set Version | ||
id: set-version | ||
run: | | ||
version=v$(cat lerna.json | jq -r .version) | ||
echo "version=$version" >> "$GITHUB_OUTPUT" | ||
- uses: planetscale/[email protected] | ||
with: | ||
commit_message: "${{steps.set-version.outputs.version}}" | ||
repo: ${{ github.repository }} | ||
branch: ${{ github.head_ref || github.ref_name }} | ||
env: | ||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
|
||
build: | ||
name: Build | ||
needs: lint | ||
|