Skip to content

Commit

Permalink
Retry
Browse files Browse the repository at this point in the history
  • Loading branch information
PEZ committed Nov 2, 2024
1 parent 93a3509 commit db9b27c
Showing 1 changed file with 55 additions and 53 deletions.
108 changes: 55 additions & 53 deletions .github/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
- name: Install Clojure
uses: DeLaGuardo/setup-clojure@v1
with:
tools-deps: '1.10.3.943'
tools-deps: '1.10.3.943'

- name: Install CLJS dependencies
run: npx shadow-cljs classpath
Expand All @@ -64,14 +64,12 @@ jobs:
run: |
VERSION=$(node -p 'require("./package.json").version')
TAG_VERSION=NO-TAG
if [[ "${GITHUB_REF}" =~ ^refs/tags/v([0-9]+\.[0-9]+\.[0-9]+)$ ]]
then
if [[ "${GITHUB_REF}" =~ ^refs/tags/v([0-9]+\.[0-9]+\.[0-9]+)$ ]]; then
TAG_VERSION=${BASH_REMATCH[1]}
echo 'No version tampering because this is a release tag'
else
COMMIT=${GITHUB_SHA:0:8}
if [[ "${GITHUB_REF}" =~ ^refs/tags/v([0-9]+\.[0-9]+\.[0-9]+)-(.*) ]]
then
if [[ "${GITHUB_REF}" =~ ^refs/tags/v([0-9]+\.[0-9]+\.[0-9]+)-(.*) ]]; then
TAG_VERSION=${BASH_REMATCH[1]}
TAG_TITLE=${BASH_REMATCH[2]}
PRERELEASE=${TAG_TITLE}-${COMMIT}
Expand All @@ -82,8 +80,7 @@ jobs:
echo "Append prerelease to version: -${PRERELEASE}"
npx json -I -f package.json -e 'this.version=this.version.replace(/$/,"-'${PRERELEASE}'")'
fi
if [ ${TAG_VERSION} = NO-TAG -o "${TAG_VERSION}" = "${VERSION}" ]
then
if [ ${TAG_VERSION} = NO-TAG -o "${TAG_VERSION}" = "${VERSION}" ]; then
VERSION=$(node -p 'require("./package.json").version')
echo "Using version: ${VERSION}"
else
Expand All @@ -93,8 +90,7 @@ jobs:
- name: Package vsix
run: |
if [[ "${GITHUB_REF}" =~ ^refs/tags/v([0-9]+\.[0-9]+\.[0-9]+)$ ]]
then
if [[ "${GITHUB_REF}" =~ ^refs/tags/v([0-9]+\.[0-9]+\.[0-9]+)$ ]]; then
echo "Packaging as release"
PACKAGE_CMD="vsce package --allow-star-activation --githubBranch master"
else
Expand Down Expand Up @@ -125,48 +121,48 @@ jobs:
name: artifacts
path: /tmp/artifacts

github-release:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Attach workspace
run: cp -r /tmp/build .

- name: Determine if prerelease
id: prerelease_check
run: |
if [[ "${GITHUB_REF}" =~ ^refs/tags/v([0-9]+\.[0-9]+\.[0-9]+)$ ]]; then
echo "::set-output name=prerelease::false"
else
echo "::set-output name=prerelease::true"
fi
- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: |
Changes:
$(awk '/^## \['${{ github.ref }}'\]/, started && /^##/ { started=1; if ($0 !~ /(^#|^\s*$)/) { gsub(/["$]/, "\\\\&"); print } }' CHANGELOG.md)
draft: false
prerelease: ${{ steps.prerelease_check.outputs.prerelease }}

- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: /tmp/artifacts/paste-replaced-$(node -p 'require("./package.json").version').vsix
asset_name: paste-replaced-$(node -p 'require("./package.json").version').vsix
asset_content_type: application/octet-stream
github-release:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Attach workspace
run: cp -r /tmp/build .

- name: Determine if prerelease
id: prerelease_check
run: |
if [[ "${GITHUB_REF}" =~ ^refs/tags/v([0-9]+\.[0-9]+\.[0-9]+)$ ]]; then
echo "::set-output name=prerelease::false"
else
echo "::set-output name=prerelease::true"
fi
- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: |
Changes:
$(awk '/^## \['${{ github.ref }}'\]/, started && /^##/ { started=1; if ($0 !~ /(^#|^\s*$)/) { gsub(/["$]/, "\\\\&"); print } }' CHANGELOG.md)
draft: false
prerelease: ${{ steps.prerelease_check.outputs.prerelease }}

- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: /tmp/artifacts/paste-replaced-$(node -p 'require("./package.json").version').vsix
asset_name: paste-replaced-$(node -p 'require("./package.json").version').vsix
asset_content_type: application/octet-stream

marketplace-publish:
runs-on: ubuntu-latest
Expand All @@ -178,7 +174,10 @@ github-release:
- name: Publish to the marketplace
run: |
VSCE_CMD="vsce publish --packagePath /tmp/artifacts/paste-replaced-$(node -p 'require("./package.json").version').vsix -p ${PUBLISH_TOKEN}"
npx ${VSCE_CMD}
if [ "${IS_LOCAL}" = YES ]; then
echo "Dry npx ${VSCE_CMD}"
else
npx ${VSCE_CMD}
open-vsx-publish:
runs-on: ubuntu-latest
Expand All @@ -190,7 +189,10 @@ github-release:
- name: Publish to Open VSX
run: |
OVSX_CMD="ovsx publish /tmp/artifacts/paste-replaced-$(node -p 'require("./package.json").version').vsix --pat ${OVSX_PUBLISH_TOKEN}"
npx ${OVSX_CMD}
if [ "${IS_LOCAL}" = YES ]; then
echo "Dry npx ${OVSX_CMD}"
else
npx ${OVSX_CMD}
bump-version:
runs-on: ubuntu-latest
Expand Down

0 comments on commit db9b27c

Please sign in to comment.