-
Notifications
You must be signed in to change notification settings - Fork 1
83 lines (69 loc) · 2.75 KB
/
release.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Release CBMC proof debugger
# A new tag of the form debugger-VERSION will trigger a new release,
# upload the package to the release page, and publish the package
# to the Microsoft Marketplace for Visual Studio Code extensions
# using the Model Checking publisher.
# Code checkout notes:
# GitHub has deprecated actions/create-release
# https://github.com/actions/create-release
#
# GitHub recommends four actions including
# softprops/action-gh-release is highly rated but includes deprecated code
# https://github.com/softprops/action-gh-release
# ncipollo/release-action@v1
# https://github.com/ncipollo/release-action
# AWS credentials notes:
# GitHub has decprecated Node12 in favor of Node16
# We use the workaround recommended by the AWS credentials package, see
# https://github.com/aws-actions/configure-aws-credentials/issues/489
# #issuecomment-1278145876
on:
push:
tags:
- debugger-*
env:
AWS_ROLE: arn:aws:iam::${{secrets.AWS_ACCOUNT}}:role/PublisherTokenReader
AWS_REGION: us-west-2
PAT_ID: AzureDevOpsPAT
jobs:
Release:
name: Release proof debugger
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Validate release and tagged version numbers
# $GITHUB_REF is refs/tags/debugger-VERSION
run: |
REL=$(jq -r '.version' package.json)
TAG=$(echo $GITHUB_REF | cut -d "/" -f 3 | cut -d "-" -f 2)
if [[ $REL != $TAG ]]; then
echo Release version $REL does not match tagged version $TAG
exit 1
fi
echo "VERSION=$REL" >> $GITHUB_ENV
- name: Create package
run: make setup-ubuntu package
- name: Create release
uses: ncipollo/release-action@v1
with:
artifacts: "*.vsix"
artifactContentType: application/zip
body: |
This release is CBMC Proof Debugger version ${{ env.VERSION }}. For the latest release, go to the [Marketplace](https://marketplace.visualstudio.com/vscode) for Visual Studio Code extensions.
To install this release, download the package `proof-debugger-${{ env.VERSION }}.vsix` below and install it with
```
code --install-extension proof-debugger-${{ env.VERSION }}.vsix
```
- name: Authenticate GitHub workflow to AWS
uses: aws-actions/configure-aws-credentials@v1-node16
with:
role-to-assume: ${{ env.AWS_ROLE }}
aws-region: ${{ env.AWS_REGION }}
- name: Publish release
run: |
export VSCE_PAT=$(aws secretsmanager get-secret-value --secret-id $PAT_ID | jq -r '.SecretString')
make publish