Skip to content

Commit

Permalink
Merge pull request #34 from rage/ci
Browse files Browse the repository at this point in the history
Ci
  • Loading branch information
Heliozoa authored Sep 9, 2024
2 parents d77b7a5 + 9522587 commit 66bf3e2
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 11 deletions.
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

0 comments on commit 66bf3e2

Please sign in to comment.