Back to one job in workflow to keep state (#117)
* Back to one job in workflow to keep state * Clean up
This commit is contained in:
54
.github/workflows/ci.yml
vendored
54
.github/workflows/ci.yml
vendored
@ -9,35 +9,11 @@ on:
|
|||||||
types: [published]
|
types: [published]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
commit-release-version:
|
build:
|
||||||
if: github.event_name == 'release'
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
env:
|
env:
|
||||||
RELEASE: ${{ github.event.release.name }}
|
RELEASE: ${{ github.event.release.name }}
|
||||||
|
RELEASE_ZIP: kittycad_diff-viewer_${{ github.event.release.name }}.zip
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3.5.2
|
|
||||||
|
|
||||||
- name: Set release package.json and manifest.json versions from tag
|
|
||||||
run: |
|
|
||||||
echo "$(jq --arg v "${RELEASE#v}" '.version=$v' package.json --indent 4)" > package.json
|
|
||||||
echo "$(jq --arg v "${RELEASE#v}" '.version=$v' public/manifest.json --indent 4)" > public/manifest.json
|
|
||||||
git diff
|
|
||||||
|
|
||||||
- name: Commit release version
|
|
||||||
run: |
|
|
||||||
git add .
|
|
||||||
git config user.name github-actions
|
|
||||||
git config user.email github-actions@github.com
|
|
||||||
git commit -m "Release version $RELEASE"
|
|
||||||
git push
|
|
||||||
|
|
||||||
install-build-test:
|
|
||||||
needs: commit-release-version
|
|
||||||
# needed for non-release workflows
|
|
||||||
if: ${{ always() }}
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3.5.2
|
- uses: actions/checkout@v3.5.2
|
||||||
@ -49,6 +25,19 @@ jobs:
|
|||||||
|
|
||||||
- run: yarn install
|
- run: yarn install
|
||||||
|
|
||||||
|
- name: Set release version to .json files and commit to main
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
run: |
|
||||||
|
git checkout main
|
||||||
|
echo "$(jq --arg v "${RELEASE#v}" '.version=$v' package.json --indent 4)" > package.json
|
||||||
|
echo "$(jq --arg v "${RELEASE#v}" '.version=$v' public/manifest.json --indent 4)" > public/manifest.json
|
||||||
|
git diff
|
||||||
|
git add .
|
||||||
|
git config user.name github-actions
|
||||||
|
git config user.email github-actions@github.com
|
||||||
|
git commit -m "Align versions with $RELEASE"
|
||||||
|
git push
|
||||||
|
|
||||||
- run: yarn build
|
- run: yarn build
|
||||||
|
|
||||||
- run: yarn test
|
- run: yarn test
|
||||||
@ -65,18 +54,8 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
path: build
|
path: build
|
||||||
|
|
||||||
deploy-release:
|
|
||||||
if: github.event_name == 'release'
|
|
||||||
needs: [commit-release-version, install-build-test]
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
env:
|
|
||||||
RELEASE_ZIP: kittycad_diff-viewer_${{ github.event.release.name }}.zip
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3.5.2
|
|
||||||
|
|
||||||
- name: Create release zip
|
- name: Create release zip
|
||||||
|
if: github.event_name == 'release'
|
||||||
run: |
|
run: |
|
||||||
zip -r $RELEASE_ZIP build/
|
zip -r $RELEASE_ZIP build/
|
||||||
|
|
||||||
@ -87,6 +66,7 @@ jobs:
|
|||||||
file: $RELEASE_ZIP
|
file: $RELEASE_ZIP
|
||||||
|
|
||||||
- name: Upload zip to Chrome Web Store
|
- name: Upload zip to Chrome Web Store
|
||||||
|
if: github.event_name == 'release'
|
||||||
uses: mobilefirstllc/cws-publish@latest
|
uses: mobilefirstllc/cws-publish@latest
|
||||||
with:
|
with:
|
||||||
action: publish
|
action: publish
|
||||||
|
Reference in New Issue
Block a user