-
Notifications
You must be signed in to change notification settings - Fork 194
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
ci(workflows): add preview support in main release #3007
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -2,6 +2,11 @@ name: release | |||||
|
||||||
on: | ||||||
workflow_dispatch: | ||||||
inputs: | ||||||
preview: | ||||||
description: 'Create a preview release' | ||||||
type: boolean | ||||||
default: true | ||||||
pull_request: | ||||||
types: [closed] | ||||||
branches: | ||||||
|
@@ -23,8 +28,12 @@ jobs: | |||||
- name: Get version | ||||||
id: release_info | ||||||
run: | | ||||||
cargo install cargo-get | ||||||
echo "tag_name=$(cargo get workspace.package.version)" >> $GITHUB_OUTPUT | ||||||
if ${{ github.event.inputs.preview }}; then | ||||||
echo "tag_name=preview--$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | ||||||
else | ||||||
cargo install cargo-get | ||||||
echo "tag_name=v$(cargo get workspace.package.version)" >> $GITHUB_OUTPUT | ||||||
fi | ||||||
|
||||||
release: | ||||||
name: ${{ matrix.job.target }} (${{ matrix.job.os }}) | ||||||
|
@@ -109,7 +118,7 @@ jobs: | |||||
- name: Archive binaries | ||||||
id: artifacts | ||||||
env: | ||||||
VERSION_NAME: v${{ needs.prepare.outputs.tag_name }} | ||||||
VERSION_NAME: ${{ needs.prepare.outputs.tag_name }} | ||||||
run: | | ||||||
if [ "$PLATFORM_NAME" == "linux" ]; then | ||||||
tar -czvf "dojo_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz" -C ./target/${TARGET}/release katana sozo torii dojo-language-server | ||||||
|
@@ -139,16 +148,16 @@ jobs: | |||||
|
||||||
# Upload these for use with the Docker build later | ||||||
- name: Upload docker binaries | ||||||
uses: actions/upload-artifact@v3 | ||||||
uses: actions/upload-artifact@v4 | ||||||
with: | ||||||
name: binaries | ||||||
name: binaries-${{ matrix.job.target }} | ||||||
path: ${{ env.PLATFORM_NAME }} | ||||||
retention-days: 1 | ||||||
|
||||||
- name: Upload release artifacts | ||||||
uses: actions/upload-artifact@v3 | ||||||
uses: actions/upload-artifact@v4 | ||||||
with: | ||||||
name: artifacts | ||||||
name: artifacts-${{ matrix.job.target }} | ||||||
path: ${{ steps.artifacts.outputs.file_name }} | ||||||
retention-days: 1 | ||||||
|
||||||
|
@@ -158,20 +167,20 @@ jobs: | |||||
env: | ||||||
GITHUB_USER: ${{ github.repository_owner }} | ||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||||||
|
||||||
if: ${{ !startsWith(needs.prepare.outputs.tag_name, 'preview') }} | ||||||
steps: | ||||||
- uses: actions/checkout@v2 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Update the checkout action version. The checkout action version is outdated and should be updated to match other actions. Apply this change: - - uses: actions/checkout@v2
+ - uses: actions/checkout@v4 This update:
📝 Committable suggestion
Suggested change
🧰 Tools🪛 actionlint (1.7.4)172-172: the runner of "actions/checkout@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue (action) |
||||||
- uses: actions/download-artifact@v3 | ||||||
- uses: actions/download-artifact@v4 | ||||||
with: | ||||||
name: artifacts | ||||||
pattern: artifacts-* | ||||||
path: artifacts | ||||||
- id: version_info | ||||||
run: | | ||||||
cargo install cargo-get | ||||||
echo "version=$(cargo get workspace.package.version)" >> $GITHUB_OUTPUT | ||||||
- name: Display structure of downloaded files | ||||||
run: ls -R artifacts | ||||||
- run: gh release create v${{ steps.version_info.outputs.version }} ./artifacts/*.gz --generate-notes --draft | ||||||
- run: gh release create ${{ steps.version_info.outputs.version }} ./artifacts/*.gz --generate-notes --draft | ||||||
|
||||||
docker-build-and-push: | ||||||
runs-on: ubuntu-20.04-4-cores | ||||||
|
@@ -182,10 +191,11 @@ jobs: | |||||
uses: actions/checkout@v2 | ||||||
|
||||||
- name: Download binaries | ||||||
uses: actions/download-artifact@v3 | ||||||
uses: actions/download-artifact@v4 | ||||||
with: | ||||||
name: binaries | ||||||
pattern: binaries-* | ||||||
path: artifacts/linux | ||||||
merge-multiple: true | ||||||
|
||||||
- name: Set up Docker Buildx | ||||||
uses: docker/setup-buildx-action@v1 | ||||||
|
@@ -201,7 +211,7 @@ jobs: | |||||
uses: docker/build-push-action@v3 | ||||||
with: | ||||||
push: true | ||||||
tags: ghcr.io/${{ github.repository }}:latest,ghcr.io/${{ github.repository }}:v${{ needs.prepare.outputs.tag_name }} | ||||||
tags: ghcr.io/${{ github.repository }}:latest,ghcr.io/${{ github.repository }}:${{ needs.prepare.outputs.tag_name }} | ||||||
platforms: linux/amd64,linux/arm64 | ||||||
build-contexts: | | ||||||
artifacts=artifacts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix matrix references in artifact steps.
The matrix.job references are undefined as these steps are not within a matrix strategy context.
These should reference specific artifact names or use a different naming strategy. Consider:
Example fix:
Also applies to: 175-175, 196-196