Skip to content

Commit 66bf3e2

Browse files
authored
Merge pull request #34 from rage/ci
Ci
2 parents d77b7a5 + 9522587 commit 66bf3e2

File tree

3 files changed

+34
-11
lines changed

3 files changed

+34
-11
lines changed

.github/workflows/linux.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
name: Linux
22

3-
on: push
3+
on:
4+
push:
5+
branches: [main, "v[0-9]+.[0-9]+.[0-9]+"]
6+
pull_request:
7+
branches: [main, "v[0-9]+.[0-9]+.[0-9]+"]
8+
release:
9+
types:
10+
- created
411

512
env:
613
CARGO_TERM_COLOR: always
@@ -32,7 +39,7 @@ jobs:
3239

3340
deploy:
3441
needs: test
35-
if: startsWith(github.ref, 'refs/tags/v')
42+
if: ${{ github.event_name == 'release' }}
3643
runs-on: ubuntu-20.04
3744
strategy:
3845
matrix:
@@ -63,7 +70,8 @@ jobs:
6370
6471
- name: Get the version
6572
id: get_version
66-
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
73+
shell: bash
74+
run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
6775

6876
- name: Deploy
6977
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 }}

.github/workflows/macos.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
name: macOS
22

3-
on: push
3+
on:
4+
push:
5+
branches: [main, "v[0-9]+.[0-9]+.[0-9]+"]
6+
pull_request:
7+
branches: [main, "v[0-9]+.[0-9]+.[0-9]+"]
8+
release:
9+
types:
10+
- created
411

512
env:
613
CARGO_TERM_COLOR: always
@@ -30,15 +37,15 @@ jobs:
3037

3138
deploy:
3239
needs: test
33-
if: startsWith(github.ref, 'refs/tags/v')
40+
if: ${{ github.event_name == 'release' }}
3441
runs-on: macos-latest
3542
steps:
3643
- uses: actions/checkout@v4
3744

3845
- uses: google-github-actions/setup-gcloud@v2
3946
with:
4047
project_id: ${{ secrets.GCP_PROJECT_ID }}
41-
service_account_key: ${{ secrets.GCP_SA_KEY }}
48+
credentials_json: ${{ secrets.GCP_SA_KEY }}
4249

4350
- name: Cargo build
4451
run: cargo build -p tmc --release --verbose
@@ -48,7 +55,8 @@ jobs:
4855

4956
- name: Get the version
5057
id: get_version
51-
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
58+
shell: bash
59+
run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
5260

5361
- name: Deploy
5462
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 }}

.github/workflows/windows.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
name: Windows
22

3-
on: push
3+
on:
4+
push:
5+
branches: [main, "v[0-9]+.[0-9]+.[0-9]+"]
6+
pull_request:
7+
branches: [main, "v[0-9]+.[0-9]+.[0-9]+"]
8+
release:
9+
types:
10+
- created
411

512
env:
613
CARGO_TERM_COLOR: always
@@ -33,7 +40,7 @@ jobs:
3340

3441
deploy:
3542
needs: test
36-
if: startsWith(github.ref, 'refs/tags/v')
43+
if: ${{ github.event_name == 'release' }}
3744
runs-on: windows-latest
3845
strategy:
3946
matrix:
@@ -44,7 +51,7 @@ jobs:
4451
- uses: google-github-actions/setup-gcloud@v2
4552
with:
4653
project_id: ${{ secrets.GCP_PROJECT_ID }}
47-
service_account_key: ${{ secrets.GCP_SA_KEY }}
54+
credentials_json: ${{ secrets.GCP_SA_KEY }}
4855

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

6370
- name: Create msi installer
6471
run: |

0 commit comments

Comments
 (0)