Release Nightly #443
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release Nightly | |
| on: | |
| schedule: | |
| - cron: '0 9 * * *' | |
| workflow_call: {} | |
| # Can be triggered manually if needed | |
| workflow_dispatch: {} | |
| jobs: | |
| check-should-build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| outputs: | |
| should_skip: ${{ steps.check_skip.outputs.skip }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Check if build should be skipped | |
| id: check_skip | |
| run: | | |
| if ./scripts/version/should-skip-nightly.sh; then | |
| echo "skip=true" >> $GITHUB_OUTPUT | |
| echo "Build will be skipped - no new commits since last nightly" | |
| else | |
| echo "skip=false" >> $GITHUB_OUTPUT | |
| echo "Build will proceed - new commits detected" | |
| fi | |
| release-nightly: | |
| needs: check-should-build | |
| if: needs.check-should-build.outputs.should_skip != 'true' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| env: | |
| ATLASCODE_FX3_API_KEY: ${{ secrets.ATLASCODE_FX3_API_KEY }} | |
| ATLASCODE_FX3_ENVIRONMENT: ${{ vars.ATLASCODE_FX3_ENVIRONMENT }} | |
| ATLASCODE_FX3_TARGET_APP: ${{ vars.ATLASCODE_FX3_TARGET_APP }} | |
| ATLASCODE_FX3_TIMEOUT: ${{ vars.ATLASCODE_FX3_TIMEOUT }} | |
| SENTRY_DSN: ${{ vars.SENTRY_DSN }} | |
| SENTRY_ENABLED: ${{ vars.SENTRY_ENABLED }} | |
| SENTRY_ENVIRONMENT: ${{ vars.SENTRY_ENVIRONMENT }} | |
| SENTRY_SAMPLE_RATE: ${{ vars.SENTRY_SAMPLE_RATE }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Evaluate version | |
| run: | | |
| PACKAGE_VERSION=$(./scripts/version/get-next-nightly.sh) | |
| ./scripts/version/assert-nightly.sh $PACKAGE_VERSION | |
| echo "PACKAGE_VERSION=${PACKAGE_VERSION}" >> $GITHUB_ENV | |
| echo "RELEASE_TAG=v${PACKAGE_VERSION}-nightly" >> $GITHUB_ENV | |
| echo "Using version '${PACKAGE_VERSION}'" | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: 'npm' | |
| - name: Set version in package.json | |
| run: npm version $PACKAGE_VERSION --no-git-tag-version --allow-same-version -f | |
| - name: Install dependencies | |
| run: npm ci --no-audit | |
| - name: Build and package the extension for pre-release | |
| run: npm run extension:package:prerelease | |
| - name: Run linter | |
| run: npm run lint | |
| - name: Run unit tests | |
| run: npm run test:nocoverage | |
| - name: Generate SSL certs for E2E test | |
| run: npm run test:e2e:sslcerts | |
| - name: Fetch E2E image | |
| run: | | |
| docker pull ghcr.io/atlassian/atlascode-e2e:latest | |
| docker tag ghcr.io/atlassian/atlascode-e2e:latest atlascode-e2e | |
| - name: Run E2E tests | |
| run: | | |
| cd e2e | |
| for target in jira-cloud jira-dc bitbucket-cloud bitbucket-dc; do | |
| TARGET=$target docker compose run --rm atlascode-e2e | |
| status=$? | |
| docker compose down | |
| if [ $status -ne 0 ]; then | |
| echo "E2E tests failed for target: $target" | |
| exit $status | |
| fi | |
| done | |
| - name: Publish the pre-release extension | |
| run: | | |
| npx vsce publish \ | |
| --pre-release \ | |
| --baseContentUrl https://raw.githubusercontent.com/atlassian/atlascode/main/ \ | |
| -p ${{ secrets.VSCE_MARKETPLACE_TOKEN }} \ | |
| --packagePath atlascode-${PACKAGE_VERSION}.vsix | |
| # This step is optional, so setting 'continue-on-error' to true | |
| - name: Publish the pre-release to OpenVSX | |
| continue-on-error: true | |
| run: | | |
| npx ovsx publish \ | |
| --pre-release \ | |
| -p ${{ secrets.OPENVSX_KEY }} \ | |
| "atlascode-${PACKAGE_VERSION}.vsix" | |
| - name: Create Tag | |
| run: | | |
| git config --global user.email "[email protected]" | |
| git config --global user.name "Nightly Release Bot" | |
| git tag -a $RELEASE_TAG -m "Nightly build for $(date +'%Y-%m-%d %H:%M')" | |
| git push origin $RELEASE_TAG | |
| - name: Create Release | |
| id: create_release | |
| uses: softprops/action-gh-release@v2 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: ${{ env.RELEASE_TAG }} | |
| name: Release ${{ env.RELEASE_TAG }} | |
| draft: false | |
| prerelease: true | |
| files: | | |
| atlascode-${{ env.PACKAGE_VERSION }}.vsix | |
| fail_on_unmatched_files: true |