Skip to content

Commit 96f2699

Browse files
committed
use right name, set right tag
1 parent fc86935 commit 96f2699

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed

.github/workflows/deploy-program.yml

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
id: set_program
4949
run: |
5050
echo program="core" >> $GITHUB_OUTPUT
51-
if [[ "${{ inputs.git_ref }}" =~ ^release/mpl-core@* ]]; then
51+
if [[ "${{ inputs.git_ref }}" =~ ^release/core@* ]]; then
5252
echo type="release" >> $GITHUB_OUTPUT
5353
else
5454
echo type="ref" >> $GITHUB_OUTPUT
@@ -96,6 +96,7 @@ jobs:
9696
uses: actions/checkout@v4
9797
with:
9898
token: ${{ secrets.SVC_TOKEN }}
99+
ref: ${{ inputs.git_ref }}
99100

100101
- name: Load environment variables
101102
run: cat .github/.env >> $GITHUB_ENV
@@ -252,9 +253,21 @@ jobs:
252253
name: 'Deploy ${{ inputs.git_ref }}}'
253254
keypair: ${{ env.SQUADS_BOT_KEY }}
254255

255-
- name: Commit and tag new version
256-
uses: stefanzweifel/git-auto-commit-action@v4
257-
if: github.event.inputs.version_program == 'true' && github.event.inputs.cluster == 'mainnet-beta'
256+
- name: Create env tag
257+
uses: actions/github-script@v5
258258
with:
259-
commit_message: Deploy mpl-${{ inputs.program }} program v${{ env.PROGRAM_VERSION }}
260-
tagging_message: mpl-${{ inputs.program }}@v${{ env.PROGRAM_VERSION }}
259+
script: |
260+
const refData = await github.rest.git.getRef({
261+
owner: context.repo.owner,
262+
repo: context.repo.repo,
263+
ref: 'tags/${{ inputs.git_ref }}'
264+
});
265+
if (refData.status !== 200) {
266+
throw new Error('Failed to fetch existing tag');
267+
}
268+
github.rest.git.createRef({
269+
owner: context.repo.owner,
270+
repo: context.repo.repo,
271+
ref: 'refs/tags/${{ needs.check_tag.outputs.program }}-${{ inputs.cluster }}',
272+
sha: refData.data.object.sha
273+
});

0 commit comments

Comments
 (0)