Skip to content

Commit

Permalink
update publish
Browse files Browse the repository at this point in the history
  • Loading branch information
Elmer Bulthuis committed Nov 7, 2023
1 parent 15a065e commit 5cece87
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/publish-goodrouter-net.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
# from https://semver.org/
SEMVER_REGEX: >
^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$
PACKAGE: goodrouter-net
steps:
- run: apt update
- run: apt install git-lfs
Expand All @@ -20,12 +21,12 @@ jobs:
lfs: true
# see https://learn.microsoft.com/en-us/dotnet/standard/library-guidance/versioning
- run: >
dotnet pack goodrouter-net/Goodrouter
dotnet pack $PACKAGE/Goodrouter
--configuration Release
--property Version=$(echo ${GITHUB_REF_NAME} | perl -pe "s/^.*?@(.*)$/\1/")
--property AssemblyVersion=$(echo ${GITHUB_REF_NAME} | perl -pe "s/^.*?@(.*)$/\1/" | perl -pe "s/${SEMVER_REGEX}/\1.0.0.0/")
--property FileVersion=$(echo ${GITHUB_REF_NAME} | perl -pe "s/^.*?@(.*)$/\1/" | perl -pe "s/${SEMVER_REGEX}/\1.\2.\3.${GITHUB_RUN_ID}/")
- run: >
dotnet nuget push
--api-key $NUGET_API_KEY
--source https://api.nuget.org/v3/index.json 'goodrouter-net/Goodrouter/bin/Release/*.nupkg'
--source https://api.nuget.org/v3/index.json $PACKAGE/Goodrouter/bin/Release/'*.nupkg'
9 changes: 3 additions & 6 deletions .github/workflows/publish-goodrouter-rs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,16 @@ on:
tags:
- goodrouter-rs@*.*.*

defaults:
run:
working-directory: goodrouter-rs

jobs:
publish-crates:
runs-on: ubuntu-latest
container: rust:1.73-alpine3.17
env:
CARGO_HOME: ${{ github.workspace }}/.cargo
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
PACKAGE: goodrouter-rs
steps:
- uses: actions/checkout@v3
- run: apk add cargo-edit
- run: cargo set-version ${GITHUB_REF_NAME:14}
- run: cargo publish --allow-dirty
- run: cargo --package $PACKAGE set-version ${GITHUB_REF_NAME:14}
- run: cargo --package $PACKAGE publish --allow-dirty
9 changes: 5 additions & 4 deletions .github/workflows/publish-goodrouter-ts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ jobs:
container: node:20.9-alpine3.17
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
PACKAGE: goodrouter-ts
steps:
- uses: actions/checkout@v3
- run: echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' >> ~/.npmrc
- run: npm --workspace ${GITHUB_REF_NAME::13} ci
- run: npm --workspace ${GITHUB_REF_NAME::13} run build
- run: npm --workspace ${GITHUB_REF_NAME::13} version ${GITHUB_REF_NAME:14}
- run: npm --workspace ${GITHUB_REF_NAME::13} publish
- run: npm --workspace $PACKAGE ci
- run: npm --workspace $PACKAGE run build
- run: npm --workspace $PACKAGE version ${GITHUB_REF_NAME:14}
- run: npm --workspace $PACKAGE publish
9 changes: 5 additions & 4 deletions .github/workflows/publish-goodrouter-www.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,16 @@ jobs:
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ vars.CLOUDFLARE_ACCOUNT_ID}}
PACKAGE: goodrouter-www
steps:
- run: apk add git-lfs
- uses: actions/checkout@v3
with:
lfs: true
- run: npm --workspace ${GITHUB_REF_NAME::14} ci
- run: npm --workspace ${GITHUB_REF_NAME::14} run build
- run: npm --workspace $PACKAGE ci
- run: npm --workspace $PACKAGE run build
- run: >
npx wrangler pages deploy ${GITHUB_REF_NAME::14}/out
npx wrangler pages deploy $PACKAGE/out
--commit-dirty=true
--project-name ${GITHUB_REF_NAME::14}
--project-name $PACKAGE
--branch main

0 comments on commit 5cece87

Please sign in to comment.