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

Ci #34

Merged
merged 2 commits into from
Sep 9, 2024
Merged

Ci #34

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
14 changes: 11 additions & 3 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
name: Linux

on: push
on:
push:
branches: [main, "v[0-9]+.[0-9]+.[0-9]+"]
pull_request:
branches: [main, "v[0-9]+.[0-9]+.[0-9]+"]
release:
types:
- created

env:
CARGO_TERM_COLOR: always
Expand Down Expand Up @@ -32,7 +39,7 @@ jobs:

deploy:
needs: test
if: startsWith(github.ref, 'refs/tags/v')
if: ${{ github.event_name == 'release' }}
runs-on: ubuntu-20.04
strategy:
matrix:
Expand Down Expand Up @@ -63,7 +70,8 @@ jobs:

- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
shell: bash
run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT

- name: Deploy
run: gsutil cp target/${{ matrix.target }}/release/tmc gs://${{ secrets.GCP_BUCKET }}/tmc-cli-rust/tmc-cli-rust-${{ matrix.target }}-${{ steps.get_version.outputs.VERSION }}
16 changes: 12 additions & 4 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
name: macOS

on: push
on:
push:
branches: [main, "v[0-9]+.[0-9]+.[0-9]+"]
pull_request:
branches: [main, "v[0-9]+.[0-9]+.[0-9]+"]
release:
types:
- created

env:
CARGO_TERM_COLOR: always
Expand Down Expand Up @@ -30,15 +37,15 @@ jobs:

deploy:
needs: test
if: startsWith(github.ref, 'refs/tags/v')
if: ${{ github.event_name == 'release' }}
runs-on: macos-latest
steps:
- uses: actions/checkout@v4

- uses: google-github-actions/setup-gcloud@v2
with:
project_id: ${{ secrets.GCP_PROJECT_ID }}
service_account_key: ${{ secrets.GCP_SA_KEY }}
credentials_json: ${{ secrets.GCP_SA_KEY }}

- name: Cargo build
run: cargo build -p tmc --release --verbose
Expand All @@ -48,7 +55,8 @@ jobs:

- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
shell: bash
run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT

- name: Deploy
run: gsutil cp target/release/tmc gs://${{ secrets.GCP_BUCKET }}/tmc-cli-rust/tmc-cli-rust-x86_64-apple-darwin-${{ steps.get_version.outputs.VERSION }}
15 changes: 11 additions & 4 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
name: Windows

on: push
on:
push:
branches: [main, "v[0-9]+.[0-9]+.[0-9]+"]
pull_request:
branches: [main, "v[0-9]+.[0-9]+.[0-9]+"]
release:
types:
- created

env:
CARGO_TERM_COLOR: always
Expand Down Expand Up @@ -33,7 +40,7 @@ jobs:

deploy:
needs: test
if: startsWith(github.ref, 'refs/tags/v')
if: ${{ github.event_name == 'release' }}
runs-on: windows-latest
strategy:
matrix:
Expand All @@ -44,7 +51,7 @@ jobs:
- uses: google-github-actions/setup-gcloud@v2
with:
project_id: ${{ secrets.GCP_PROJECT_ID }}
service_account_key: ${{ secrets.GCP_SA_KEY }}
credentials_json: ${{ secrets.GCP_SA_KEY }}

- name: Enable long paths for git
run: git config --system core.longpaths true # allow long paths from git deps
Expand All @@ -58,7 +65,7 @@ jobs:
- name: Get the version
id: get_version
shell: bash
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT

- name: Create msi installer
run: |
Expand Down