Skip to content

Commit

Permalink
More publishing fixes (#20)
Browse files Browse the repository at this point in the history
Worked this time:


https://www.npmjs.com/package/@weaveworksoss/backstage-plugin-flux?activeTab=versions

Now have some junk releases on npm which doesn't seem to mind, we could
consider publishing from branches to make it easier to test things.
  • Loading branch information
foot authored Jul 6, 2023
1 parent 5af19a0 commit 105aadc
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,15 @@ on:
release:
types: [published]
jobs:
build:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
# get all the tags from git so we can run
# $(git describe --tags) and get something useful
# e.g. v0.6.0 or v0.6.0-1-gf0a2b3c
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: '16.x'
Expand Down
18 changes: 17 additions & 1 deletion plugins/backstage-plugin-flux/publish.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
#!/usr/bin/env bash

# bail on error
set -e
# print each command
set -x

# e.g.
# v0.6.0 for a tag
# v0.6.0-1-gf0a2b3c for some non-tagged commit
NEW_VERSION=$(git describe --always --tags --match "v*")

# npm requires that leading v to be stripped to be "valid semver"
# e.g. 0.6.0
STRIPPED_NEW_VERSION=$(echo $NEW_VERSION | sed -e 's/^v//')

yarn clean
yarn tsc
yarn build
yarn publish

# don't git commit or push
yarn publish --new-version $STRIPPED_NEW_VERSION --no-git-tag-version

0 comments on commit 105aadc

Please sign in to comment.