Skip to content

Commit

Permalink
ci: Fix up NPM workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
joeyparrish committed Oct 21, 2023
1 parent 792381b commit e56acb3
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@

## Required Repo Secrets
- `RELEASE_PLEASE_TOKEN`: A PAT for `shaka-bot` to run the `release-please`
action
action. If missing, the release workflow will use the default
`GITHUB_TOKEN`
- `DOCKERHUB_CI_USERNAME`: The username of the Docker Hub CI account
- `DOCKERHUB_CI_TOKEN`: An access token for Docker Hub
- To generate, visit https://hub.docker.com/settings/security
Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/publish-npm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,21 @@ jobs:
NPM_TAG=$(echo "$GIT_TAG_NAME" | cut -f 1-2 -d .)-latest
echo "NPM_TAG=$NPM_TAG" >> $GITHUB_ENV
# Since we also set the package version on-the-fly during publication,
# compute that here. It's the tag without the leading "v".
NPM_VERSION=$(echo "$GIT_TAG_NAME" | sed -e 's/^v//')
echo "NPM_VERSION=$NPM_VERSION" >> $GITHUB_ENV
# Debug the decisions made here.
echo "This release: $GIT_TAG_NAME"
echo "NPM tag: $NPM_TAG"
echo "NPM version: $NPM_VERSION"
- name: Set package name
- name: Set package name and version
run: |
sed npm/package.json -i \
-e 's/"name": ""/"name": "${{ secrets.NPM_PACKAGE_NAME }}"/'
-e 's/"name": ""/"name": "${{ secrets.NPM_PACKAGE_NAME }}"/' \
-e 's/"version": ""/"version": "$NPM_VERSION"/'
- name: Publish
env:
Expand All @@ -84,6 +91,5 @@ jobs:
# Add the "latest" tag if needed.
if [[ "${{ github.event.inputs.latest }}" == "true" ]]; then
NPM_VERSION=$(npm version --json | jq -r '."shaka-packager"')
npm dist-tag add "shaka-packager@$NPM_VERSION" latest
fi
2 changes: 0 additions & 2 deletions .github/workflows/release-please.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ jobs:
default-branch: ${{ github.ref_name }}
# Use a special shaka-bot access token for releases.
token: ${{ secrets.RELEASE_PLEASE_TOKEN || secrets.GITHUB_TOKEN }}
# Update these additional files containing version numbers.
extra-files: npm/package.json
# Temporary settings to bootstrap v3.0.0.
last-release-sha: 634af6591ce8c701587a78042ae7f81761725710
bootstrap-sha: 634af6591ce8c701587a78042ae7f81761725710
Expand Down
3 changes: 2 additions & 1 deletion npm/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"name": "",
"description": "A media packaging tool and SDK.",
"version": "0.0.0",
"version": "",
"private": false,
"homepage": "https://github.com/shaka-project/shaka-packager",
"author": "Google",
"maintainers": [
Expand Down

0 comments on commit e56acb3

Please sign in to comment.