Skip to content

Commit

Permalink
ci(WIP): run publish with dry run and enable v1 publishing
Browse files Browse the repository at this point in the history
Signed-off-by: Lachezar Lechev <[email protected]>
  • Loading branch information
elpiel committed Jan 12, 2024
1 parent 2b707b6 commit 8773afd
Showing 1 changed file with 25 additions and 24 deletions.
49 changes: 25 additions & 24 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,28 @@ name: Publish
on:
release:
types: [published]

jobs:
# FIXME: needs a running server locally for the local-addon
# publish-v1:
# if: ${{ startsWith(github.event.release.tag_name, 'v1') }}
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# - name: Setup NodeJS
# uses: actions/setup-node@v4
# with:
# node-version: 20
# cache: 'npm'
# registry-url: https://registry.npmjs.org/
# - name: Install NPM dependencies
# run: npm ci
# - name: Publish to NPM
# run: npm publish --workspace stremio-official-addons --access public
# env:
# NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
publish-v1:
if: ${{ startsWith(github.event.release.tag_name, 'v1') }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup NodeJS
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
registry-url: https://registry.npmjs.org/
- name: Install NPM dependencies
run: npm ci
# At this point, the index.json is manually updated and committed for v1
# No need to generate the addons list
- name: Publish to NPM
run: npm publish --workspace stremio-official-addons --access public --dry-run
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}

publish-v2:
if: ${{ startsWith(github.event.release.tag_name, 'v2') }}
Expand All @@ -41,13 +42,13 @@ jobs:
uses: dtolnay/[email protected]
- name: Install NPM dependencies
run: npm ci
- name: Build
- name: Build addons list
run: npm run --workspace official-addons-v2 build
- name: Publish to NPM
run: npm publish --workspace official-addons-v2 --access public
run: npm publish --workspace official-addons-v2 --access public --dry-run
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
- name: Publish to crates.io
run: cargo publish -p stremio-official-addons --allow-dirty --token "$CARGO_AUTH_TOKEN"
- name: Build and publish crate to crates.io
run: cargo publish -p stremio-official-addons --allow-dirty --token "$CARGO_AUTH_TOKEN" --dry-run
env:
CARGO_AUTH_TOKEN: ${{ secrets.CRATES_IO_PUBLISH_TOKEN }}

0 comments on commit 8773afd

Please sign in to comment.