Skip to content

Commit

Permalink
fix: latest CD fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
replydev committed Feb 16, 2024
1 parent 09023c9 commit 2b6cc8a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: Deploy
on:
workflow_dispatch:
inputs:
tag:
description: 'Tag name used to deploy the version'
new_version:
description: New version to deploy
required: true
type: string

Expand Down Expand Up @@ -95,7 +95,7 @@ jobs:
- name: Build archive
shell: bash
env:
TAG: ${{ inputs.tag }}
NEW_VERSION: ${{ inputs.new_version }}
run: |
set -ex
Expand All @@ -110,7 +110,7 @@ jobs:
if [[ "$platform" == *"win"* ]]; then
exe=".exe"
fi
pkgname=$PROJECT_NAME-$TAG-$platform
pkgname=$PROJECT_NAME-$NEW_VERSION-$platform
mkdir tmp/$pkgname
# cp LICENSE README.md tmp/$pkgname
mv cotp-$platform/$BIN_NAME$exe tmp/$pkgname
Expand All @@ -129,7 +129,7 @@ jobs:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/*
file_glob: true
tag: ${{ inputs.tag }}
tag: v${{ inputs.new_version }}
overwrite: true

publish_on_cargo_crates:
Expand Down Expand Up @@ -167,7 +167,7 @@ jobs:
- name: Generate PKGBUILDs
shell: bash
run: |
python ci/build_pkgbuild.py ${{ inputs.tag }}
python ci/build_pkgbuild.py ${{ inputs.new_version }}
cat ./ci/cotp/PKGBUILD
cat ./ci/cotp-bin/PKGBUILD
Expand All @@ -179,7 +179,7 @@ jobs:
commit_username: ${{ secrets.AUR_USERNAME }}
commit_email: ${{ secrets.AUR_EMAIL }}
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
commit_message: Update cotp package to version ${{ inputs.tag }}
commit_message: Update cotp package to version ${{ inputs.new_version }}
ssh_keyscan_types: rsa,dsa,ecdsa,ed25519

- name: "Clean repo dir"
Expand All @@ -195,5 +195,5 @@ jobs:
commit_username: ${{ secrets.AUR_USERNAME }}
commit_email: ${{ secrets.AUR_EMAIL }}
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
commit_message: Update cotp-bin package to version ${{ inputs.tag }}
commit_message: Update cotp-bin package to version ${{ inputs.new_version }}
ssh_keyscan_types: rsa,dsa,ecdsa,ed25519
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
- name: Install Semantic Release globally
run: npm install -g semantic-release @semantic-release/git @semantic-release/exec

# Semantic Release configuration executes gh CLI which triggers the deploy workflow
- name: Release with semantic versioning
run: npx semantic-release
env:
Expand Down
5 changes: 3 additions & 2 deletions .releaserc
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
[
"@semantic-release/exec",
{
"prepareCmd": "ci/write_cargo_version.sh ${nextRelease.version}",
"successCmd": "gh workflow run Deploy -f tag=${nextRelease.version}"
"successCmd": "gh workflow run Deploy -f new_version=${nextRelease.version}"
}
],
[
"@semantic-release/git",
{
"assets": ["Cargo.toml", "Cargo.lock"]
"assets": ["Cargo.toml", "Cargo.lock", "CHANGELOG.md"]
}
],
"@semantic-release/github"
Expand Down

0 comments on commit 2b6cc8a

Please sign in to comment.