-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(publish): update workflow and enable dry run on push to
master
- Loading branch information
Showing
3 changed files
with
25 additions
and
31 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -1,7 +1,10 @@ | ||
name: publish | ||
|
||
on: | ||
# pull_request: | ||
push: | ||
branches: | ||
- master | ||
tags: | ||
- "*" | ||
|
||
|
@@ -17,8 +20,10 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') | ||
|
||
- name: Create release | ||
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
prerelease: ${{ contains(github.ref, '-') }} | ||
|
@@ -46,6 +51,9 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Run sccache-cache | ||
uses: mozilla-actions/[email protected] | ||
|
||
- name: Setup extra build tools | ||
if: matrix.target == 'aarch64-unknown-linux-musl' | ||
run: | | ||
|
@@ -74,7 +82,7 @@ jobs: | |
needs: [build-release] | ||
runs-on: ubuntu-latest | ||
container: | ||
# Note: It is also possible to install `choco` directly: | ||
# NOTE: It is also possible to install `choco` directly: | ||
# https://github.com/JetBrains/qodana-cli/blob/29134e654dc4878e0587f02338c5101bce327560/.github/workflows/release.yml#L19-L27 | ||
image: chocolatey/choco:latest-linux | ||
steps: | ||
|
@@ -87,7 +95,7 @@ jobs: | |
- name: Setup Golang | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: ">=1.20.0" | ||
go-version: stable | ||
|
||
# https://github.com/vercel/turbo/blob/ea934d13038361c24a1f71cad3b490d6c0936f37/.github/workflows/turborepo-release.yml#L306-L309 | ||
- name: Download artifacts | ||
|
@@ -104,11 +112,11 @@ jobs: | |
chown -R $(id -u):$(id -g) $PWD | ||
chmod -R 744 target/gh-artifacts | ||
ls -laR target/gh-artifacts | ||
mv -f target/gh-artifacts/pacaptr-x86_64-pc-windows-msvc target/gh-artifacts/pacaptr_windows_amd64_v1 | ||
mv -f target/gh-artifacts/pacaptr-x86_64-pc-windows-msvc target/gh-artifacts/pacaptr_windows_amd64 | ||
mv -f target/gh-artifacts/pacaptr-aarch64-pc-windows-msvc target/gh-artifacts/pacaptr_windows_arm64 | ||
mv -f target/gh-artifacts/pacaptr-x86_64-apple-darwin target/gh-artifacts/pacaptr_darwin_amd64_v1 | ||
mv -f target/gh-artifacts/pacaptr-x86_64-apple-darwin target/gh-artifacts/pacaptr_darwin_amd64 | ||
mv -f target/gh-artifacts/pacaptr-aarch64-apple-darwin target/gh-artifacts/pacaptr_darwin_arm64 | ||
mv -f target/gh-artifacts/pacaptr-x86_64-unknown-linux-musl target/gh-artifacts/pacaptr_linux_amd64_v1 | ||
mv -f target/gh-artifacts/pacaptr-x86_64-unknown-linux-musl target/gh-artifacts/pacaptr_linux_amd64 | ||
mv -f target/gh-artifacts/pacaptr-aarch64-unknown-linux-musl target/gh-artifacts/pacaptr_linux_arm64 | ||
echo '=======' | ||
ls -laR target/gh-artifacts | ||
|
@@ -119,7 +127,7 @@ jobs: | |
with: | ||
distribution: goreleaser | ||
version: latest | ||
args: release --debug | ||
args: release --clean --verbose ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags/') && ' ' || '--snapshot --skip=publish' }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
TAP_GITHUB_TOKEN: ${{ secrets.TAP_GITHUB_TOKEN }} | ||
|
@@ -134,5 +142,6 @@ jobs: | |
# https://github.com/goreleaser/goreleaser/blob/2a3009757a8996cdcf2a77deb0e5fa413d1f2660/internal/pipe/chocolatey/chocolatey.go#L201-L208 | ||
# https://stackoverflow.com/a/75835172 | ||
- name: Publish app on Chocolatey | ||
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') | ||
run: | | ||
choco push dist/*.nupkg --source https://push.chocolatey.org --api-key ${{ secrets.CHOCO_API_KEY }} --verbose ${{ contains(github.ref, '-') && '--noop' || '' }} | ||
choco push dist/*.nupkg --source https://push.chocolatey.org --api-key ${{ secrets.CHOCO_API_KEY }} --verbose ${{ contains(github.ref, '-') && '--noop' || ' ' }} |
This file contains 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 |
---|---|---|
|
@@ -28,8 +28,8 @@ jobs: | |
concurrent_skipping: same_content | ||
do_not_skip: '["pull_request"]' | ||
|
||
build: | ||
name: build (${{ matrix.os }} native + ${{ matrix.target2 }}) | ||
lint: | ||
name: lint (${{ matrix.os }}) | ||
needs: skip-check | ||
if: ${{ needs.skip-check.outputs.should_skip != 'true' }} | ||
runs-on: ${{ matrix.os }} | ||
|
@@ -38,28 +38,15 @@ jobs: | |
matrix: | ||
include: | ||
- os: windows-latest | ||
# target: x86_64-pc-windows-msvc | ||
target2: aarch64-pc-windows-msvc | ||
- os: macos-latest | ||
# target: aarch64-apple-darwin | ||
target2: x86_64-apple-darwin | ||
- os: ubuntu-latest | ||
# target: x86_64-unknown-linux-musl | ||
target2: aarch64-unknown-linux-musl | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup extra build tools | ||
if: matrix.target2 == 'aarch64-unknown-linux-musl' | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y gcc-aarch64-linux-gnu | ||
- name: Run sccache-cache | ||
uses: mozilla-actions/[email protected] | ||
- name: Setup Rust | ||
if: ${{ steps.cache_build.outputs.cache-hit != 'true' }} | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
targets: ${{ matrix.target2 }} | ||
- name: Setup `cargo-binstall` and `taplo` | ||
uses: taiki-e/install-action@v2 | ||
with: | ||
|
@@ -76,11 +63,6 @@ jobs: | |
- name: Lint Rust | ||
run: | | ||
cargo clippy --all-targets --all-features | ||
- name: Build | ||
if: ${{ steps.cache_build.outputs.cache-hit != 'true' }} | ||
run: | | ||
cargo build --verbose --locked | ||
cargo build --verbose --locked --target=${{ matrix.target2 }} | ||
choco-test: | ||
runs-on: windows-latest | ||
|
@@ -399,7 +381,7 @@ jobs: | |
# https://github.com/PyO3/pyo3/blob/42601f3af94242b017402b763a495798a92da8f8/.github/workflows/ci.yml#L452-L472 | ||
conclusion: | ||
needs: | ||
- build | ||
- lint | ||
- choco-test | ||
- scoop-winget-test | ||
- brew-test | ||
|
This file contains 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