diff --git a/.github/workflows/deploy_to_ghcr_tag_release.yaml b/.github/workflows/deploy_to_ghcr_tag_release.yaml index b6254a67..153a29dc 100644 --- a/.github/workflows/deploy_to_ghcr_tag_release.yaml +++ b/.github/workflows/deploy_to_ghcr_tag_release.yaml @@ -12,6 +12,7 @@ on: permissions: packages: write contents: write + pull-requests: write jobs: version_update: @@ -23,20 +24,41 @@ jobs: fetch-depth: 0 - uses: actions4git/setup-git@v1 - + - name: Update version in package.json id: version run: | - git checkout -b temp-version-update + git checkout main version=$(npm version from-git --no-git-tag-version) + echo "version=$version" >> $GITHUB_OUTPUT + echo "NPM version is $version" + + if [ "${{ github.event.release.tag_name }}" != "$version" ]; then + echo "Release tag does not match the expected version." + exit 1 + fi + cd api npm version from-git --no-git-tag-version - git add package.json - git commit --signoff --message $version - git checkout main - git merge temp-version-update + cd .. + git add . + git commit --signoff --message $version + + echo "moving tag $version" git tag --force $version - git push origin main -f --tags + git push origin $version --force + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v7 + with: + title: '🚀Update version to ${{ steps.version.outputs.version }}' + body: | + This PR updates the version to ${{ steps.version.outputs.version }}. + Use **merge commit** strategy for this PR! + branch: 'version-update-${{ steps.version.outputs.version }}' + delete-branch: true + labels: 'version-update' + base: 'main' push_to_ghcr: runs-on: ubuntu-latest @@ -44,6 +66,8 @@ jobs: steps: - name: Checkout GitHub Action uses: actions/checkout@v4 + with: + ref: ${{ github.event.release.tag_name }} - name: Login to GitHub Container Registry uses: docker/login-action@v3 @@ -82,6 +106,8 @@ jobs: steps: - name: Checkout GitHub Action uses: actions/checkout@v4 + with: + ref: ${{ github.event.release.tag_name }} - name: Login to GitHub Container Registry uses: docker/login-action@v3 diff --git a/api/package-lock.json b/api/package-lock.json index 4aec5031..e1c437e4 100644 --- a/api/package-lock.json +++ b/api/package-lock.json @@ -1,12 +1,12 @@ { "name": "gh-api", - "version": "1.0.0", + "version": "1.9.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "gh-api", - "version": "1.0.0", + "version": "1.9.0", "license": "ISC", "dependencies": { "axios": "^1.7.2", diff --git a/api/package.json b/api/package.json index 218b07dc..208cb5c3 100644 --- a/api/package.json +++ b/api/package.json @@ -1,6 +1,6 @@ { "name": "gh-api", - "version": "1.0.0", + "version": "1.9.0", "main": "server.js", "scripts": { "start": "node server.mjs", diff --git a/package-lock.json b/package-lock.json index 46423f4e..44cc5d06 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "copilot-metrics-viewer", - "version": "1.8.0", + "version": "1.9.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "copilot-metrics-viewer", - "version": "1.8.0", + "version": "1.9.0", "dependencies": { "@mdi/font": "5.9.55", "axios": "^1.7.9", diff --git a/package.json b/package.json index f0770e15..139d1321 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "copilot-metrics-viewer", - "version": "1.8.0", + "version": "1.9.0", "private": true, "scripts": { "serve": "vue-cli-service serve", diff --git a/src/App.vue b/src/App.vue index ad8f5f69..4fce4588 100644 --- a/src/App.vue +++ b/src/App.vue @@ -3,7 +3,7 @@ - + {{ new Date().getFullYear() }} — Copilot Metrics Viewer — {{ version }} @@ -29,3 +29,10 @@ export default defineComponent({ }, }) + + \ No newline at end of file