-
Notifications
You must be signed in to change notification settings - Fork 37
use manual workflow dispatch to publish artifacts #149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 37 commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
b244785
use manual workflow dispatch to publish artifacts
kmvachhani 9719fcf
Revert "use manual workflow dispatch to publish artifacts"
kmvachhani 6ee3964
create new publish all workflow
kmvachhani c91669a
keep tagging step in build action
kmvachhani 6cc8aab
move tag release to CI job
kmvachhani d37d607
update maturin version
kmvachhani c0eb49a
explicitly setup python for aarch64 windows
kmvachhani e15a9e6
fix typo
kmvachhani f15446c
log info about the runners
kmvachhani 21c0654
manually setup correct libraries for windows aarch64
kmvachhani 43a8d79
self review fixes
kmvachhani 74dfd5b
temporarily change action trigger to test
kmvachhani 339daae
fix target branch
kmvachhani 0770ef3
fix workflow
kmvachhani b0d7e23
fix workflow format
kmvachhani 86c9d29
clean up file
kmvachhani 922f69d
remove runs-on parameter
kmvachhani 976f94a
skip publishing existing packages
kmvachhani 6d77685
add skip-existing flag
kmvachhani a0abd04
add special case for x86_64-unknown-linux-gnu target
kmvachhani e5702b7
fix indentation
kmvachhani e0a7217
check which part of script is failing
kmvachhani 94fa027
change correct step
kmvachhani e024283
add correct docker parameter in publish path
kmvachhani c98651e
switch workflow to run on manual trigger
kmvachhani 7cc5b18
self review
kmvachhani 9dbdee5
try reusing existing build steps
kmvachhani fff4c78
fix job name reference
kmvachhani 95ddef6
add missing permissions
kmvachhani 066f347
include inputs from publish job
kmvachhani 0d259c0
remove PR trigger
kmvachhani c6afb82
explicitly list out secrets
kmvachhani 646ac75
pass publish flag to build.yml
kmvachhani 8af4409
pass maturin password
kmvachhani 3a82ba7
add publish parameter to ci runs
kmvachhani 22c6cc9
final workflow trigger for publish
kmvachhani 13f1625
add default for publish from ci
kmvachhani 90cc157
keep env variables for versions
kmvachhani File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,7 +4,23 @@ env: | |
| APP_NAME: ngrok | ||
| MACOSX_DEPLOYMENT_TARGET: '10.13' | ||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| publish: | ||
| required: false | ||
| default: false | ||
| type: boolean | ||
| secrets: | ||
| NGROK_AUTHTOKEN: | ||
| required: true | ||
| MATURIN_PASSWORD: | ||
| required: true | ||
| push: | ||
| inputs: | ||
| publish: | ||
| required: false | ||
| default: false | ||
| type: boolean | ||
| branches: | ||
| - '**' | ||
| tags-ignore: | ||
|
|
@@ -15,11 +31,7 @@ on: | |
| - '**/*.gitignore' | ||
| - .editorconfig | ||
| - docs/** | ||
| workflow_dispatch: | ||
| pull_request: | ||
| types: [opened, reopened] | ||
| branches: | ||
| - main | ||
|
|
||
| jobs: | ||
| udeps: | ||
| name: Udeps | ||
|
|
@@ -61,42 +73,19 @@ jobs: | |
| run: | | ||
| NGROK_AUTHTOKEN=${{ secrets.NGROK_AUTHTOKEN }} make mypy | ||
| NGROK_AUTHTOKEN=${{ secrets.NGROK_AUTHTOKEN }} make testfast | ||
| decide: | ||
kmvachhani marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| name: Decide on Publishing | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Decide | ||
| id: decide | ||
| run: | | ||
| echo "github.ref: ${{ github.ref }}" | ||
| echo "github.repository: ${{ github.repository }}" | ||
| echo "git log:" | ||
| git log -1 --pretty=%B | ||
|
|
||
| if [ '${{ github.ref }}' == 'refs/heads/main' ] && [ '${{ github.repository }}' == 'ngrok/ngrok-python' ] && git log -1 --pretty=%B | grep "^Release [0-9]\+\.[0-9]\+\.[0-9]\+$"; then | ||
| echo "SHOULD_PUBLISH=true" >> $GITHUB_OUTPUT | ||
| else | ||
| echo "SHOULD_PUBLISH=false" >> $GITHUB_OUTPUT | ||
| fi | ||
| cat $GITHUB_OUTPUT | ||
| outputs: | ||
| publish: ${{ steps.decide.outputs.SHOULD_PUBLISH }} | ||
|
|
||
| build: | ||
| needs: | ||
| - clippy | ||
| - decide | ||
| - fmt | ||
| - test | ||
| - udeps | ||
| uses: ./.github/workflows/build.yml | ||
| secrets: inherit | ||
| with: | ||
| publish: ${{ inputs.publish || false }} | ||
| docker: ${{ matrix.settings.docker }} | ||
| host: ${{ matrix.settings.host }} | ||
| if: true | ||
| publish: ${{ needs.decide.outputs.publish }} | ||
| setup: ${{ matrix.settings.setup }} | ||
| target: ${{ matrix.settings.target }} | ||
| strategy: | ||
|
|
@@ -123,6 +112,7 @@ jobs: | |
| docker: ghcr.io/rust-cross/manylinux2014-cross:armv7 | ||
| - host: ubuntu-latest | ||
| target: x86_64-unknown-linux-gnu | ||
| docker: ghcr.io/rust-cross/manylinux2014-cross:x86_64 | ||
| - host: ubuntu-latest | ||
| target: x86_64-unknown-linux-musl | ||
| docker: alpine:3.21 | ||
|
|
@@ -136,7 +126,6 @@ jobs: | |
| target: x86_64-pc-windows-msvc | ||
|
|
||
| build-freebsd: | ||
| needs: decide | ||
| runs-on: ubuntu-22.04 | ||
| name: Build FreeBSD | ||
| timeout-minutes: 20 | ||
|
|
@@ -152,9 +141,8 @@ jobs: | |
| RUSTUP_HOME: /usr/local/rustup | ||
| CARGO_HOME: /usr/local/cargo | ||
| RUSTUP_IO_THREADS: 1 | ||
| SHOULD_PUBLISH: ${{ needs.decide.outputs.publish }} | ||
| with: | ||
| envs: RUSTUP_HOME CARGO_HOME RUSTUP_IO_THREADS SHOULD_PUBLISH | ||
| envs: RUSTUP_HOME CARGO_HOME RUSTUP_IO_THREADS | ||
| usesh: true | ||
| mem: 3000 | ||
| prepare: | | ||
|
|
@@ -167,37 +155,12 @@ jobs: | |
| export PATH="/usr/local/cargo/bin:$PATH" | ||
| python3 -m venv .env | ||
| . .env/bin/activate && pip install -r requirements.txt | ||
| if [ "${SHOULD_PUBLISH}" == 'true' ]; then | ||
| echo "~~~~ maturin just building since pypi doesn't support BSD wheels" | ||
| # https://discuss.python.org/t/pypi-org-unsupported-platform-tag-openbsd-7-0-amd64/16302 | ||
| # . .env/bin/activate && maturin publish --no-sdist -u __token__ -p ${{ secrets.MATURIN_PASSWORD }} | ||
| . .env/bin/activate && maturin build | ||
| else | ||
| echo "~~~~ maturin building" | ||
| . .env/bin/activate && maturin build | ||
| fi | ||
| # make the rsync back faster | ||
| echo "~~~~ maturin building" | ||
| . .env/bin/activate && maturin build | ||
| rm -rf .env/ target/debug/ target/release/ | ||
| - name: Upload artifact | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: bindings-freebsd | ||
| path: target/wheels/*.whl | ||
| if-no-files-found: error | ||
| tag: | ||
| if: ${{ github.ref == 'refs/heads/main' && needs.decide.outputs.publish == true }} | ||
| needs: | ||
| - decide | ||
| - build | ||
| runs-on: ubuntu-latest | ||
| name: Tag Release | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: jrobsonchase/[email protected] | ||
| - name: Tag | ||
| run: | | ||
| version="$(extract-crate-version ngrok-python)" | ||
| git config user.name "GitHub Action" | ||
| git config user.email [email protected] | ||
| git tag -a -m "Version ${version}" v${version} | ||
| git push --tags | ||
| if-no-files-found: error | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| name: Publish All | ||
| on: | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| ci: | ||
| name: Run CI | ||
| uses: ./.github/workflows/ci.yml | ||
| secrets: | ||
| NGROK_AUTHTOKEN: ${{ secrets.NGROK_AUTHTOKEN }} | ||
| MATURIN_PASSWORD: ${{ secrets.MATURIN_PASSWORD }} | ||
| permissions: | ||
| contents: write | ||
| with: | ||
| publish: true | ||
| tag-release: | ||
| name: Tag Release | ||
| needs: ci | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: jrobsonchase/[email protected] | ||
| - name: Tag Release | ||
| run: | | ||
| version="$(grep '^version =' Cargo.toml | head -n1 | awk -F\" '{print $2}')" | ||
| tag="v${version}" | ||
| git config user.name "GitHub Action" | ||
| git config user.email [email protected] | ||
| echo "Version: ${version} tag: $tag" | ||
| echo "Fetching all tags in the repository" | ||
| git fetch --tags | ||
| if git rev-parse "refs/tags/$tag" >/dev/null 2>&1; then | ||
| echo "Tag $tag already exists, skipping tag creation." | ||
| else | ||
| echo "Tag $tag does not exist, pushing tag." | ||
| git tag -a -m "Version ${version}" $tag | ||
| git push --tags | ||
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.