Skip to content
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

Fix release workflows, again #1214

Merged
merged 1 commit into from
Oct 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 10 additions & 28 deletions .github/workflows/test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,47 +102,29 @@ jobs:
registry-url: https://registry.npmjs.org
- run: npm install
- run:
npm ${{ inputs.release && 'publish' || 'publish --dry-run' }}
npm ${{ inputs.release && 'publish' || 'publish --dry-run' }} || ${{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not just use conditional workflow steps?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, it would be much clearer for any post analysis.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But we'd need to use up some of our newline quota 😄

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that the extra || ${{ inputs.release && 'true' || 'false' }} was immediately reverted with #1215; I added it to make the (non-dry) publish process idempotent, because trying to publish an existing version would fail.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ternary operator

- run: npm ${{ inputs.release && 'publish' || 'publish --dry-run' }}
  env:
    NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

Conditional steps

- if: inputs.release == true
  run: npm publish
  env:
    NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- if: inputs.release != true
  run: npm publish --dry-run
  env:
    NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy to deplete our newline quota if you feel it's necessary 😄

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WTB this as a future required change for the next person to edit said lines.

inputs.release && 'true' || 'false' }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: install ldid
run: |
- run: |
sudo apt install --yes libplist-dev
git clone --branch v2.1.5 git://git.saurik.com/ldid.git
sudo g++ -pipe -o /usr/bin/ldid ldid/ldid.cpp -I. -x c ldid/{lookup2.c,sha1.h} -lplist -lcrypto
- id: build
name: build
run: |
echo ::set-output name=tag::${GITHUB_REF#refs/tags/}
- run: |
cp node_modules/@npcz/magic/dist/magic.mgc assets/magic.mgc
npx --yes pkg --no-bytecode --public-packages "*" --public package.json
rm assets/magic.mgc
for cmd in '' runner publish pr; do
build/cml-linux-x64 $cmd --version
done
for cmd in '' runner publish pr; do build/cml-linux-x64 $cmd --version; done
cp build/cml-linux{-x64,}
cp build/cml-macos{-x64,}
- uses: softprops/action-gh-release@v1
if: inputs.release
with:
files: |
build/cml-alpine-arm64
build/cml-alpine-x64
build/cml-linux-arm64
build/cml-linuxstatic-arm64
build/cml-linuxstatic-x64
build/cml-linux-x64
build/cml-linux
build/cml-macos-arm64
build/cml-macos-x64
build/cml-macos
build/cml-win-arm64.exe
build/cml-win-x64.exe
- if: inputs.release
run:
find build -type f | xargs gh release upload $(basename ${{
github.head_ref }})
env:
GITHUB_TOKEN: ${{ secrets.TEST_GITHUB_TOKEN }}
images:
needs: packages
secrets: inherit
uses: ./.github/workflows/images.yml
with:
release: ${{ inputs.release }}
release: ${{ inputs.release || false }}
0x2b3bfa0 marked this conversation as resolved.
Show resolved Hide resolved
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dvcorg/cml",
"version": "0.18.1",
"version": "0.18.0",
"description": "<p align=\"center\"> <img src=\"https://static.iterative.ai/img/cml/title_strip_trim.png\" width=400> </p>",
"author": {
"name": "Iterative Inc",
Expand Down